| 1 | /* |
| 2 | * L4_MABX.c |
| 3 | * |
| 4 | * Code generation for model "L4_MABX". |
| 5 | * |
| 6 | * Model version : 1.893 |
| 7 | * Simulink Coder version : 8.14 (R2018a) 06-Feb-2018 |
| 8 | * C source code generated on : Wed Jan 29 15:34:41 2020 |
| 9 | * |
| 10 | * Target selection: rti1401.tlc |
| 11 | * Note: GRT includes extra infrastructure and instrumentation for prototyping |
| 12 | * Embedded hardware selection: Custom Processor->Custom |
| 13 | * Code generation objectives: Unspecified |
| 14 | * Validation result: Not run |
| 15 | */ |
| 16 | |
| 17 | #include "L4_MABX_trc_ptr.h" |
| 18 | #include "L4_MABX.h" |
| 19 | #include "L4_MABX_private.h" |
| 20 | |
| 21 | /* Named constants for Chart: '<S79>/Chart' */ |
| 22 | #define L4_MABX_IN_Init ((uint8_T)1U) |
| 23 | #define L4_MABX_IN_NO_ACTIVE_CHILD ((uint8_T)0U) |
| 24 | #define L4_MABX_IN_OperatorDisabled ((uint8_T)2U) |
| 25 | #define L4_MABX_IN_OperatorEnabled ((uint8_T)3U) |
| 26 | |
| 27 | /* Named constants for Chart: '<S211>/Relay_control_state_machine' */ |
| 28 | #define L4_MABX_IN_IGN_RELAY_LATCH ((uint8_T)1U) |
| 29 | #define L4_MABX_IN_IGN_RELAY_UNLATCH ((uint8_T)1U) |
| 30 | #define L4_MABX_IN_INITIAL ((uint8_T)1U) |
| 31 | #define L4_MABX_IN_INV_RELAY_LATCH ((uint8_T)2U) |
| 32 | #define L4_MABX_IN_INV_RELAY_UNLATCH ((uint8_T)2U) |
| 33 | #define L4_MABX_IN_MABX_RELAY_LATCH ((uint8_T)3U) |
| 34 | #define L4_MABX_IN_MABX_RELAY_UNLATCH ((uint8_T)3U) |
| 35 | #define L4_MABX_IN_POWER_DOWN_ROUTINE ((uint8_T)2U) |
| 36 | #define L4_MABX_IN_POWER_UP_ROUTINE ((uint8_T)3U) |
| 37 | #define L4_MABX_IN_SENSOR_RELAY_LATCH ((uint8_T)4U) |
| 38 | #define L4_MABX_IN_SENSOR_RELAY_UNLATCH ((uint8_T)4U) |
| 39 | #define L4_MABX_IN_WAIT ((uint8_T)5U) |
| 40 | |
| 41 | /* Named constants for Chart: '<S283>/Chart' */ |
| 42 | #define L4_MABX_IN_OneLane ((uint8_T)1U) |
| 43 | #define L4_MABX_IN_OneLane1 ((uint8_T)2U) |
| 44 | #define L4_MABX_IN_TwoLanes ((uint8_T)3U) |
| 45 | #define L4_MABX_IN_TwoLanes1 ((uint8_T)4U) |
| 46 | #define L4_MABX_IN_ZeroLanes ((uint8_T)5U) |
| 47 | #define L4_MABX_IN_ZeroLanes1 ((uint8_T)6U) |
| 48 | #define L4_MABX_IN_init_h ((uint8_T)7U) |
| 49 | |
| 50 | /* Named constants for Chart: '<S763>/Health State Machine PWM Sensor 1' */ |
| 51 | #define L4_MABX_IN_ERROR ((uint8_T)1U) |
| 52 | #define L4_MABX_IN_FAILURE_DETECTED ((uint8_T)1U) |
| 53 | #define L4_MABX_IN_NO_FAILURE ((uint8_T)2U) |
| 54 | #define L4_MABX_IN_PENDING ((uint8_T)2U) |
| 55 | |
| 56 | /* Named constants for Chart: '<S845>/Chart' */ |
| 57 | #define L4_MABX_IN_DiagPassed ((uint8_T)1U) |
| 58 | #define L4_MABX_IN_SwitchOff ((uint8_T)2U) |
| 59 | #define L4_MABX_IN_SwitchOn ((uint8_T)3U) |
| 60 | #define L4_MABX_IN_init_l ((uint8_T)4U) |
| 61 | |
| 62 | /* Named constants for Chart: '<S859>/Chart' */ |
| 63 | #define L4_MABX_IN_CheckPacketCount ((uint8_T)1U) |
| 64 | #define L4_MABX_IN_Init_i ((uint8_T)2U) |
| 65 | #define L4_MABX_IN_InterframeDelay ((uint8_T)3U) |
| 66 | #define L4_MABX_IN_InterframeDelay1 ((uint8_T)4U) |
| 67 | #define L4_MABX_IN_SendTPCM ((uint8_T)5U) |
| 68 | #define L4_MABX_IN_SendTPDT ((uint8_T)6U) |
| 69 | #define L4_MABX_IN_StartMsg ((uint8_T)7U) |
| 70 | #define L4_MABX_IN_WaitForNextPeriod ((uint8_T)8U) |
| 71 | |
| 72 | /* Exported block signals */ |
| 73 | real_T GLB_Absolute_Timestamp; /* '<S417>/Rate Transition' */ |
| 74 | real_T ReAX_ActualHandwheelPos; /* '<S443>/Switch' */ |
| 75 | real_T EthernetLinkStatus; /* '<S399>/dsa_tcpip_setup' */ |
| 76 | real_T CurrentAzimuth_rad; /* '<S397>/Switch' */ |
| 77 | real_T TargetAzimuth_rad; /* '<S397>/Switch1' */ |
| 78 | real_T TargetVelocity_kph; /* '<S397>/Switch3' */ |
| 79 | real_T Curvature; /* '<S397>/Switch4' */ |
| 80 | real_T CrosstrackError; /* '<S397>/Switch5' */ |
| 81 | real_T CurrentVelocity_kph; /* '<S397>/Switch2' */ |
| 82 | real_T GPS_X; /* '<S397>/Switch6' */ |
| 83 | real_T GPS_Y; /* '<S397>/Switch7' */ |
| 84 | real_T GPS_Time; /* '<S397>/Switch8' */ |
| 85 | real_T ReAX_EchoedSteerWheelPos; /* '<S443>/Switch' */ |
| 86 | real_T SteerWheelAngle; /* '<S645>/S-Function1' */ |
| 87 | real_T YawRate; /* '<S645>/S-Function1' */ |
| 88 | real_T SPN1810_LongitudinalAcceleration;/* '<S645>/S-Function1' */ |
| 89 | real_T WheelBasedVehicleSpeed; /* '<S506>/S-Function1' */ |
| 90 | real_T BrakeSwitch; /* '<S506>/S-Function1' */ |
| 91 | real_T Lateral_Control_Rate_Limit; /* '<S310>/Constant' */ |
| 92 | real_T Lateral_Control_Output; /* '<S281>/Sum1' */ |
| 93 | real_T Lateral_Control_Rate_Limiter_Output;/* '<S310>/If_Then_Else' */ |
| 94 | real_T SteerCommandDeg; /* '<S80>/sign flip' */ |
| 95 | real_T DesiredSteeringAngle; /* '<S80>/sign2' */ |
| 96 | real_T Lateral_Control_Heading_Error; /* '<S281>/Error Calc' */ |
| 97 | uint32_T DIAG_CAN1_Count_Stuff_Errors; /* '<S28>/S-Function1' */ |
| 98 | uint32_T DIAG_CAN1_Count_Format_Errors;/* '<S28>/S-Function1' */ |
| 99 | uint32_T DIAG_CAN1_Count_Ack_Errors; /* '<S28>/S-Function1' */ |
| 100 | uint32_T DIAG_CAN1_Count_Bit0_Errors; /* '<S28>/S-Function1' */ |
| 101 | uint32_T DIAG_CAN1_Count_Bit1_Errors; /* '<S28>/S-Function1' */ |
| 102 | uint32_T DIAG_CAN1_Count_CRC_Errors; /* '<S28>/S-Function1' */ |
| 103 | uint32_T DIAG_CAN1_Count_RX_Lost; /* '<S28>/S-Function1' */ |
| 104 | uint32_T DIAG_CAN1_Count_RX_OK; /* '<S28>/S-Function1' */ |
| 105 | uint32_T DIAG_CAN1_Count_TX_OK; /* '<S28>/S-Function1' */ |
| 106 | uint32_T DIAG_CAN5_Count_Stuff_Errors; /* '<S20>/S-Function1' */ |
| 107 | uint32_T DIAG_CAN5_Count_Format_Errors;/* '<S20>/S-Function1' */ |
| 108 | uint32_T DIAG_CAN5_Count_Ack_Errors; /* '<S20>/S-Function1' */ |
| 109 | uint32_T DIAG_CAN5_Count_Bit0_Errors; /* '<S20>/S-Function1' */ |
| 110 | uint32_T DIAG_CAN5_Count_Bit1_Errors; /* '<S20>/S-Function1' */ |
| 111 | uint32_T DIAG_CAN5_Count_CRC_Errors; /* '<S20>/S-Function1' */ |
| 112 | uint32_T DIAG_CAN5_Count_RX_Lost; /* '<S20>/S-Function1' */ |
| 113 | uint32_T DIAG_CAN5_Count_RX_OK; /* '<S20>/S-Function1' */ |
| 114 | uint32_T DIAG_CAN5_Count_TX_OK; /* '<S20>/S-Function1' */ |
| 115 | uint32_T DIAG_CAN6_Count_Stuff_Errors; /* '<S21>/S-Function1' */ |
| 116 | uint32_T DIAG_CAN6_Count_Format_Errors;/* '<S21>/S-Function1' */ |
| 117 | uint32_T DIAG_CAN6_Count_Ack_Errors; /* '<S21>/S-Function1' */ |
| 118 | uint32_T DIAG_CAN6_Count_Bit0_Errors; /* '<S21>/S-Function1' */ |
| 119 | uint32_T DIAG_CAN6_Count_Bit1_Errors; /* '<S21>/S-Function1' */ |
| 120 | uint32_T DIAG_CAN6_Count_CRC_Errors; /* '<S21>/S-Function1' */ |
| 121 | uint32_T DIAG_CAN6_Count_RX_Lost; /* '<S21>/S-Function1' */ |
| 122 | uint32_T DIAG_CAN6_Count_RX_OK; /* '<S21>/S-Function1' */ |
| 123 | uint32_T DIAG_CAN6_Count_TX_OK; /* '<S21>/S-Function1' */ |
| 124 | uint32_T DIAG_CAN3_Count_Stuff_Errors; /* '<S18>/S-Function1' */ |
| 125 | uint32_T DIAG_CAN3_Count_Format_Errors;/* '<S18>/S-Function1' */ |
| 126 | uint32_T DIAG_CAN3_Count_Ack_Errors; /* '<S18>/S-Function1' */ |
| 127 | uint32_T DIAG_CAN3_Count_Bit0_Errors; /* '<S18>/S-Function1' */ |
| 128 | uint32_T DIAG_CAN3_Count_Bit1_Errors; /* '<S18>/S-Function1' */ |
| 129 | uint32_T DIAG_CAN3_Count_CRC_Errors; /* '<S18>/S-Function1' */ |
| 130 | uint32_T DIAG_CAN3_Count_RX_Lost; /* '<S18>/S-Function1' */ |
| 131 | uint32_T DIAG_CAN3_Count_RX_OK; /* '<S18>/S-Function1' */ |
| 132 | uint32_T DIAG_CAN3_Count_TX_OK; /* '<S18>/S-Function1' */ |
| 133 | uint32_T DIAG_CAN4_Count_Stuff_Errors; /* '<S19>/S-Function1' */ |
| 134 | uint32_T DIAG_CAN4_Count_Format_Errors;/* '<S19>/S-Function1' */ |
| 135 | uint32_T DIAG_CAN4_Count_Ack_Errors; /* '<S19>/S-Function1' */ |
| 136 | uint32_T DIAG_CAN4_Count_Bit0_Errors; /* '<S19>/S-Function1' */ |
| 137 | uint32_T DIAG_CAN4_Count_Bit1_Errors; /* '<S19>/S-Function1' */ |
| 138 | uint32_T DIAG_CAN4_Count_CRC_Errors; /* '<S19>/S-Function1' */ |
| 139 | uint32_T DIAG_CAN4_Count_RX_Lost; /* '<S19>/S-Function1' */ |
| 140 | uint32_T DIAG_CAN4_Count_RX_OK; /* '<S19>/S-Function1' */ |
| 141 | uint32_T DIAG_CAN4_Count_TX_OK; /* '<S19>/S-Function1' */ |
| 142 | uint32_T DIAG_CAN2_Count_Stuff_Errors; /* '<S17>/S-Function1' */ |
| 143 | uint32_T DIAG_CAN2_Count_Format_Errors;/* '<S17>/S-Function1' */ |
| 144 | uint32_T DIAG_CAN2_Count_Ack_Errors; /* '<S17>/S-Function1' */ |
| 145 | uint32_T DIAG_CAN2_Count_Bit0_Errors; /* '<S17>/S-Function1' */ |
| 146 | uint32_T DIAG_CAN2_Count_Bit1_Errors; /* '<S17>/S-Function1' */ |
| 147 | uint32_T DIAG_CAN2_Count_CRC_Errors; /* '<S17>/S-Function1' */ |
| 148 | uint32_T DIAG_CAN2_Count_RX_Lost; /* '<S17>/S-Function1' */ |
| 149 | uint32_T DIAG_CAN2_Count_RX_OK; /* '<S17>/S-Function1' */ |
| 150 | uint32_T DIAG_CAN2_Count_TX_OK; /* '<S17>/S-Function1' */ |
| 151 | real32_T REAX_Handwheel_Torque; /* '<S419>/Data Type Conversion3' */ |
| 152 | real32_T REAX_Handwheel_Velocity; /* '<S419>/Data Type Conversion4' */ |
| 153 | real32_T REAX_Pull_Compensation; /* '<S419>/Data Type Conversion5' */ |
| 154 | ENUM_CAN_STATUS_DIAG_T DIAG_CAN1_Status;/* '<S1>/Data Type Conversion' */ |
| 155 | ENUM_CAN_STATUS_DIAG_T DIAG_CAN5_Status;/* '<S1>/Data Type Conversion5' */ |
| 156 | ENUM_CAN_STATUS_DIAG_T DIAG_CAN6_Status;/* '<S1>/Data Type Conversion4' */ |
| 157 | ENUM_CAN_STATUS_DIAG_T DIAG_CAN3_Status;/* '<S1>/Data Type Conversion3' */ |
| 158 | ENUM_CAN_STATUS_DIAG_T DIAG_CAN4_Status;/* '<S1>/Data Type Conversion2' */ |
| 159 | ENUM_CAN_STATUS_DIAG_T DIAG_CAN2_Status;/* '<S1>/Data Type Conversion1' */ |
| 160 | uint8_T SupervisorMode; /* '<S397>/Switch9' */ |
| 161 | uint8_T REAX_Current_Mode; /* '<S419>/Data Type Conversion' */ |
| 162 | uint8_T REAX_Req_Mode; /* '<S419>/Data Type Conversion1' */ |
| 163 | uint8_T REAX_Status; /* '<S419>/Data Type Conversion2' */ |
| 164 | uint8_T GLB_SWVERSION_CPV_[100]; /* '<S1091>/Constant' */ |
| 165 | uint8_T MABX_Mode; /* '<S76>/Switch' */ |
| 166 | boolean_T EStop; /* '<S416>/Logical Operator1' */ |
| 167 | boolean_T EnableSw; /* '<S745>/Switch' */ |
| 168 | boolean_T EngagePB; /* '<S743>/AND2' */ |
| 169 | boolean_T BrakeSW; /* '<S416>/Logical Operator3' */ |
| 170 | boolean_T MABX_Heartbeat; /* '<S398>/Cast To Boolean' */ |
| 171 | boolean_T Heartbeat_Ok; /* '<S403>/Switch1' */ |
| 172 | boolean_T RTMapsOk; /* '<S397>/AND' */ |
| 173 | boolean_T LogEventPB; /* '<S742>/AND2' */ |
| 174 | boolean_T EngageReq; /* '<S96>/AND' */ |
| 175 | boolean_T AutonomousEnabled; /* '<S76>/AND' */ |
| 176 | boolean_T AutonomousOutputEnabled; /* '<S76>/Autonomous Mode Switch' */ |
| 177 | boolean_T RateLimiterActive; /* '<S319>/Compare' */ |
| 178 | real_T Pedal_pwm_position; /* '<S765>/Switch' */ |
| 179 | |
| 180 | /* Exported block parameters */ |
| 181 | real_T APTC_PEDAL_LOW_IDLE_SW_THR_APV = 3.0;/* Variable: APTC_PEDAL_LOW_IDLE_SW_THR_APV |
| 182 | * Referenced by: '<S75>/Constant' |
| 183 | */ |
| 184 | real_T APTC_TRQ_PED_INV_MAP_PED_POS_MPV[1328] = { 0.0, 0.3125, 0.859375, 1.15625, |
| 185 | 1.59375, 1.8125, 1.921875, 2.375, 3.8125, 4.3125, 4.84375, 4.96875, 5.71875, |
| 186 | 6.28125, 6.5625, 6.890625, 7.0, 7.8606557377049, 9.1229508196721, |
| 187 | 10.327868852459, 11.532786885246, 14.0, 15.25748502994, 15.425149700599, |
| 188 | 15.718562874251, 16.808383233533, 17.730538922156, 18.023952095808, |
| 189 | 18.275449101796, 18.904191616766, 19.449101796407, 19.658682634731, |
| 190 | 19.74251497006, 19.826347305389, 20.287425149701, 21.0, 21.516393442623, |
| 191 | 22.290983606557, 23.409836065574, 24.758196721311, 24.959016393443, |
| 192 | 25.217213114754, 26.22131147541, 26.995901639344, 27.311475409836, |
| 193 | 27.454918032787, 27.512295081967, 27.684426229508, 28.0, 32.101910828025, |
| 194 | 32.235668789809, 34.687898089172, 35.0, 36.734104046243, 38.815028901734, |
| 195 | 42.28323699422, 42.514450867052, 44.364161849711, 51.878612716763, 55.0, |
| 196 | 72.260273972603, 79.041095890411, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 197 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 198 | 100.0, 100.0, 100.0, 100.0, 0.0, 0.33333333333333, 0.91666666666667, |
| 199 | 1.2333333333333, 1.7, 1.9333333333333, 2.05, 2.5333333333333, 4.0666666666667, |
| 200 | 4.6, 5.1666666666667, 5.3, 6.1, 6.7, 7.0, 8.3738317757009, 8.8317757009346, |
| 201 | 9.8130841121495, 11.252336448598, 12.626168224299, 14.0, 15.559585492228, |
| 202 | 16.647668393782, 16.79274611399, 17.046632124352, 17.989637305699, |
| 203 | 18.787564766839, 19.041450777202, 19.259067357513, 19.80310880829, |
| 204 | 20.274611398964, 20.455958549223, 20.528497409326, 20.60103626943, 21.0, |
| 205 | 21.476, 21.98, 22.736, 23.828, 25.144, 25.34, 25.592, 26.572, 27.328, 27.636, |
| 206 | 27.776, 27.832, 28.0, 28.478260869565, 32.478260869565, 32.608695652174, 35.0, |
| 207 | 35.777777777778, 37.444444444444, 39.444444444444, 42.777777777778, 43.0, |
| 208 | 44.777777777778, 52.0, 55.0, 61.237623762376, 63.688118811881, 71.262376237624, |
| 209 | 75.160891089109, 78.613861386139, 96.769801980198, 97.660891089109, |
| 210 | 98.329207920792, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 211 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 0.57377049180328, |
| 212 | 1.577868852459, 2.1229508196721, 2.9262295081967, 3.327868852459, |
| 213 | 3.5286885245902, 4.3606557377049, 7.0, 7.8549618320611, 8.763358778626, |
| 214 | 8.9770992366412, 10.259541984733, 11.221374045802, 11.702290076336, |
| 215 | 12.263358778626, 12.450381679389, 12.851145038168, 13.43893129771, 14.0, |
| 216 | 14.757731958763, 16.309278350515, 17.39175257732, 17.536082474227, |
| 217 | 17.788659793814, 18.726804123711, 19.520618556701, 19.773195876289, |
| 218 | 19.989690721649, 20.530927835052, 21.0, 21.132575757576, 21.185606060606, |
| 219 | 21.238636363636, 21.530303030303, 21.981060606061, 22.458333333333, |
| 220 | 23.174242424242, 24.208333333333, 25.454545454545, 25.640151515152, |
| 221 | 25.878787878788, 26.806818181818, 27.522727272727, 27.814393939394, |
| 222 | 27.94696969697, 28.0, 28.202898550725, 28.574879227053, 31.685990338164, |
| 223 | 31.787439613527, 33.647342995169, 33.884057971014, 34.391304347826, 35.0, |
| 224 | 36.704545454545, 36.818181818182, 37.727272727273, 41.420454545455, |
| 225 | 42.954545454545, 46.136363636364, 47.386363636364, 51.25, 53.238636363636, |
| 226 | 55.0, 64.249684741488, 64.703656998739, 65.044136191677, 65.895334174023, |
| 227 | 75.769230769231, 79.457755359395, 82.919293820933, 84.451450189155, |
| 228 | 93.417402269861, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 229 | 0.0, 0.92105263157895, 2.5328947368421, 3.4078947368421, 4.6973684210526, |
| 230 | 5.3421052631579, 5.6644736842105, 7.0, 8.9339339339339, 9.6066066066066, |
| 231 | 10.321321321321, 10.489489489489, 11.498498498498, 12.255255255255, |
| 232 | 12.633633633634, 13.075075075075, 13.222222222222, 13.537537537538, 14.0, |
| 233 | 14.65625, 15.3125, 16.65625, 17.59375, 17.71875, 17.9375, 18.75, 19.4375, |
| 234 | 19.65625, 19.84375, 20.3125, 20.71875, 20.875, 20.9375, 21.0, 21.310483870968, |
| 235 | 21.790322580645, 22.298387096774, 23.060483870968, 24.161290322581, |
| 236 | 25.487903225806, 25.685483870968, 25.939516129032, 26.927419354839, |
| 237 | 27.689516129032, 28.0, 28.143442622951, 28.200819672131, 28.372950819672, |
| 238 | 28.688524590164, 31.327868852459, 31.41393442623, 32.991803278689, |
| 239 | 33.19262295082, 33.622950819672, 34.139344262295, 35.0, 35.082474226804, |
| 240 | 35.742268041237, 38.422680412371, 39.536082474227, 41.845360824742, |
| 241 | 42.752577319588, 45.556701030928, 47.0, 48.278350515464, 55.0, 55.39603960396, |
| 242 | 55.693069306931, 56.435643564356, 65.049504950495, 68.267326732673, |
| 243 | 71.287128712871, 72.623762376238, 80.445544554455, 86.188118811881, |
| 244 | 97.326732673267, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, |
| 245 | 1.2068965517241, 3.3189655172414, 4.4655172413793, 6.1551724137931, 7.0, |
| 246 | 7.1412103746398, 7.7262247838617, 9.5821325648415, 10.227665706052, |
| 247 | 10.913544668588, 11.07492795389, 12.043227665706, 12.769452449568, |
| 248 | 13.132564841499, 13.556195965418, 13.697406340058, 14.0, 14.599221789883, |
| 249 | 15.171206225681, 15.743190661479, 16.91439688716, 17.731517509728, |
| 250 | 17.84046692607, 18.031128404669, 18.739299610895, 19.338521400778, |
| 251 | 19.529182879377, 19.692607003891, 20.101167315175, 20.455252918288, |
| 252 | 20.591439688716, 20.645914396887, 20.700389105058, 21.0, 21.526548672566, |
| 253 | 22.08407079646, 22.920353982301, 24.128318584071, 25.58407079646, |
| 254 | 25.800884955752, 26.079646017699, 27.163716814159, 28.0, 28.282051282051, |
| 255 | 28.410256410256, 28.461538461538, 28.615384615385, 28.897435897436, |
| 256 | 31.25641025641, 31.333333333333, 32.74358974359, 32.923076923077, |
| 257 | 33.307692307692, 33.769230769231, 34.538461538462, 34.589743589744, 35.0, |
| 258 | 36.768707482993, 37.503401360544, 39.027210884354, 39.625850340136, |
| 259 | 41.47619047619, 42.428571428571, 43.272108843537, 47.707482993197, |
| 260 | 47.925170068027, 48.08843537415, 48.496598639456, 53.231292517007, 55.0, |
| 261 | 57.99672489083, 59.323144104803, 67.085152838428, 72.78384279476, |
| 262 | 83.837336244541, 86.490174672489, 91.550218340611, 99.312227074236, 100.0, |
| 263 | 100.0, 100.0, 100.0, 0.0, 1.8918918918919, 5.2027027027027, 7.0, |
| 264 | 7.5340599455041, 7.8010899182561, 7.9346049046322, 8.4877384196185, |
| 265 | 10.242506811989, 10.852861035422, 11.50136239782, 11.653950953678, |
| 266 | 12.569482288828, 13.256130790191, 13.599455040872, 14.0, 14.185606060606, |
| 267 | 14.583333333333, 15.166666666667, 15.723484848485, 16.280303030303, |
| 268 | 17.420454545455, 18.215909090909, 18.32196969697, 18.507575757576, |
| 269 | 19.19696969697, 19.780303030303, 19.965909090909, 20.125, 20.522727272727, |
| 270 | 20.867424242424, 21.0, 21.065420560748, 21.130841121495, 21.490654205607, |
| 271 | 22.046728971963, 22.635514018692, 23.518691588785, 24.794392523364, |
| 272 | 26.331775700935, 26.560747663551, 26.855140186916, 28.0, 28.665492957746, |
| 273 | 28.93661971831, 29.05985915493, 29.109154929577, 29.257042253521, |
| 274 | 29.528169014085, 31.795774647887, 31.869718309859, 33.225352112676, |
| 275 | 33.397887323944, 33.767605633803, 34.211267605634, 34.950704225352, 35.0, |
| 276 | 35.381406436234, 36.930870083433, 37.574493444577, 38.909415971395, |
| 277 | 39.433849821216, 41.054827175209, 41.88915375447, 42.628128724672, |
| 278 | 46.513706793802, 46.704410011919, 46.847437425507, 47.205005959476, |
| 279 | 51.352800953516, 52.902264600715, 54.356376638856, 55.0, 62.917594654788, |
| 280 | 68.730512249443, 80.005567928731, 82.711581291759, 87.873051224944, |
| 281 | 95.790645879733, 96.492204899777, 100.0, 100.0, 100.0, 0.0, 7.0, |
| 282 | 7.8448275862069, 8.3034482758621, 8.9793103448276, 9.3172413793103, |
| 283 | 9.4862068965517, 10.186206896552, 12.406896551724, 13.179310344828, 14.0, |
| 284 | 14.157303370787, 15.101123595506, 15.808988764045, 16.162921348315, |
| 285 | 16.575842696629, 16.713483146067, 17.008426966292, 17.441011235955, |
| 286 | 17.85393258427, 18.266853932584, 19.112359550562, 19.702247191011, |
| 287 | 19.780898876404, 19.918539325843, 20.429775280899, 20.862359550562, 21.0, |
| 288 | 21.192660550459, 21.674311926606, 22.091743119266, 22.252293577982, |
| 289 | 22.316513761468, 22.380733944954, 22.733944954128, 23.279816513761, |
| 290 | 23.857798165138, 24.724770642202, 25.977064220183, 27.48623853211, |
| 291 | 27.711009174312, 28.0, 28.910780669145, 29.613382899628, 29.899628252788, |
| 292 | 30.029739776952, 30.081784386617, 30.237918215613, 30.524163568773, |
| 293 | 32.918215613383, 32.996282527881, 34.42750929368, 34.609665427509, 35.0, |
| 294 | 35.417633410673, 36.113689095128, 36.160092807425, 36.5313225058, |
| 295 | 38.039443155452, 38.665893271462, 39.965197215777, 40.475638051044, |
| 296 | 42.053364269142, 42.865429234339, 43.584686774942, 47.366589327146, |
| 297 | 47.552204176334, 47.691415313225, 48.039443155452, 52.07656612529, |
| 298 | 53.584686774942, 55.0, 56.296691568837, 63.884738527215, 69.455709711846, |
| 299 | 80.261472785486, 82.854855923159, 87.801494130203, 95.389541088581, |
| 300 | 96.061899679829, 99.423692636073, 100.0, 100.0, 0.0, 7.0, 9.378640776699, |
| 301 | 10.669902912621, 12.572815533981, 13.52427184466, 14.0, 14.394941634241, |
| 302 | 15.647859922179, 16.083657587549, 16.546692607004, 16.655642023346, |
| 303 | 17.309338521401, 17.799610894942, 18.044747081712, 18.330739299611, |
| 304 | 18.426070038911, 18.630350194553, 18.929961089494, 19.215953307393, |
| 305 | 19.501945525292, 20.087548638132, 20.496108949416, 20.550583657588, |
| 306 | 20.645914396887, 21.0, 21.836956521739, 22.103260869565, 22.33152173913, |
| 307 | 22.902173913043, 23.396739130435, 23.586956521739, 23.663043478261, |
| 308 | 23.739130434783, 24.157608695652, 24.804347826087, 25.489130434783, |
| 309 | 26.516304347826, 28.0, 29.305555555556, 29.5, 29.75, 30.722222222222, |
| 310 | 31.472222222222, 31.777777777778, 31.916666666667, 31.972222222222, |
| 311 | 32.138888888889, 32.444444444444, 35.0, 35.073529411765, 36.421568627451, |
| 312 | 36.593137254902, 36.960784313725, 37.401960784314, 38.137254901961, |
| 313 | 38.186274509804, 38.578431372549, 40.171568627451, 40.833333333333, |
| 314 | 42.205882352941, 42.745098039216, 44.411764705882, 45.269607843137, |
| 315 | 46.029411764706, 50.024509803922, 50.220588235294, 50.367647058824, |
| 316 | 50.735294117647, 55.0, 57.720930232558, 60.274418604651, 61.404651162791, |
| 317 | 68.018604651163, 72.874418604651, 82.293023255814, 84.553488372093, |
| 318 | 88.86511627907, 95.479069767442, 96.06511627907, 98.995348837209, |
| 319 | 99.497674418605, 100.0, 0.0, 14.0, 14.419520547945, 14.647260273973, |
| 320 | 14.982876712329, 15.150684931507, 15.234589041096, 15.582191780822, |
| 321 | 16.684931506849, 17.068493150685, 17.47602739726, 17.571917808219, |
| 322 | 18.147260273973, 18.578767123288, 18.794520547945, 19.046232876712, |
| 323 | 19.130136986301, 19.309931506849, 19.573630136986, 19.825342465753, |
| 324 | 20.077054794521, 20.592465753425, 20.952054794521, 21.0, 21.324503311258, |
| 325 | 22.529801324503, 23.549668874172, 23.87417218543, 24.152317880795, |
| 326 | 24.847682119205, 25.450331125828, 25.682119205298, 25.774834437086, |
| 327 | 25.867549668874, 26.377483443709, 27.165562913907, 28.0, 28.913043478261, |
| 328 | 30.231884057971, 31.821256038647, 32.057971014493, 32.36231884058, |
| 329 | 33.545893719807, 34.458937198068, 34.830917874396, 35.0, 35.054200542005, |
| 330 | 35.216802168022, 35.514905149051, 38.008130081301, 38.089430894309, |
| 331 | 39.579945799458, 39.769647696477, 40.176151761518, 40.663956639566, |
| 332 | 41.476964769648, 41.531165311653, 41.964769647696, 43.726287262873, |
| 333 | 44.457994579946, 45.975609756098, 46.571815718157, 48.414634146341, |
| 334 | 49.363143631436, 50.20325203252, 54.620596205962, 54.837398373984, 55.0, |
| 335 | 55.583910034602, 62.357266435986, 64.887543252595, 67.262110726644, |
| 336 | 68.313148788927, 74.463667820069, 78.979238754325, 87.737889273356, |
| 337 | 89.839965397924, 93.849480968858, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 14.0, |
| 338 | 14.708092485549, 15.092485549133, 15.658959537572, 15.942196531792, |
| 339 | 16.083815028902, 16.670520231214, 18.531791907514, 19.179190751445, |
| 340 | 19.867052023121, 20.028901734104, 21.0, 21.739002932551, 22.108504398827, |
| 341 | 22.539589442815, 22.683284457478, 22.991202346041, 23.442815249267, |
| 342 | 23.873900293255, 24.304985337243, 25.187683284457, 25.803519061584, |
| 343 | 25.885630498534, 26.029325513196, 26.563049853372, 27.014662756598, |
| 344 | 27.158357771261, 27.281524926686, 27.589442815249, 27.856304985337, |
| 345 | 27.958944281525, 28.0, 28.083333333333, 28.541666666667, 29.25, 30.0, 31.125, |
| 346 | 32.75, 34.708333333333, 35.0, 35.291734197731, 36.426256077796, |
| 347 | 37.301458670989, 37.658022690438, 37.820097244733, 37.884927066451, |
| 348 | 38.079416531605, 38.435980551053, 41.418152350081, 41.515397082658, |
| 349 | 43.298217179903, 43.525121555916, 44.011345218801, 44.594813614263, |
| 350 | 45.567260940032, 45.63209076175, 46.150729335494, 48.257698541329, |
| 351 | 49.132901134522, 50.948136142626, 51.661264181523, 53.865478119935, 55.0, |
| 352 | 56.15671641791, 62.238805970149, 62.537313432836, 62.761194029851, |
| 353 | 63.320895522388, 69.813432835821, 72.238805970149, 74.514925373134, |
| 354 | 75.522388059701, 81.417910447761, 85.746268656716, 94.141791044776, |
| 355 | 96.15671641791, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 14.0, |
| 356 | 16.987804878049, 18.609756097561, 21.0, 21.175942549372, 21.263913824057, |
| 357 | 21.628366247756, 22.784560143627, 23.18671454219, 23.614003590664, |
| 358 | 23.714542190305, 24.317773788151, 24.770197486535, 24.996409335727, |
| 359 | 25.260323159785, 25.34829443447, 25.536804308797, 25.81328545781, |
| 360 | 26.077199281867, 26.341113105925, 26.881508078995, 27.258527827648, |
| 361 | 27.308797127469, 27.396768402154, 27.723518850987, 28.0, 28.39837398374, |
| 362 | 28.739837398374, 29.593495934959, 30.333333333333, 30.617886178862, |
| 363 | 30.731707317073, 30.845528455285, 31.471544715447, 32.439024390244, |
| 364 | 33.463414634146, 35.0, 36.553784860558, 38.426294820717, 38.705179282869, |
| 365 | 39.06374501992, 40.458167330677, 41.533864541833, 41.972111553785, |
| 366 | 42.171314741036, 42.250996015936, 42.490039840637, 42.92828685259, |
| 367 | 46.593625498008, 46.713147410359, 48.90438247012, 49.183266932271, |
| 368 | 49.780876494024, 50.498007968127, 51.693227091633, 51.772908366534, |
| 369 | 52.410358565737, 55.0, 55.966587112172, 57.971360381862, 58.758949880668, |
| 370 | 61.193317422434, 62.44630071599, 63.556085918854, 69.391408114558, |
| 371 | 69.677804295943, 69.892601431981, 70.429594272076, 76.658711217184, |
| 372 | 78.985680190931, 81.169451073986, 82.136038186158, 87.792362768496, |
| 373 | 91.945107398568, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, |
| 374 | 21.0, 21.414551607445, 21.639593908629, 21.971235194585, 22.137055837563, |
| 375 | 22.219966159052, 22.56345177665, 23.653130287648, 24.032148900169, |
| 376 | 24.434856175973, 24.529610829103, 25.098138747885, 25.524534686971, |
| 377 | 25.737732656514, 25.986463620981, 26.06937394247, 26.24703891709, |
| 378 | 26.507614213198, 26.756345177665, 27.005076142132, 27.514382402707, |
| 379 | 27.869712351946, 27.917089678511, 28.0, 30.394736842105, 32.421052631579, |
| 380 | 33.065789473684, 33.618421052632, 35.0, 35.668380462725, 35.925449871465, |
| 381 | 36.028277634961, 36.131105398458, 36.696658097686, 37.570694087404, |
| 382 | 38.496143958869, 39.884318766067, 41.889460154242, 44.305912596401, |
| 383 | 44.665809768638, 45.12853470437, 46.928020565553, 48.316195372751, |
| 384 | 48.881748071979, 49.13881748072, 49.241645244216, 49.550128534704, |
| 385 | 50.115681233933, 54.845758354756, 55.0, 57.201957295374, 57.482206405694, |
| 386 | 58.082740213523, 58.803380782918, 60.004448398577, 60.084519572954, |
| 387 | 60.725088967972, 63.327402135231, 64.408362989324, 66.650355871886, |
| 388 | 67.531138790036, 70.253558718861, 71.654804270463, 72.89590747331, |
| 389 | 79.421708185053, 79.741992882562, 79.982206405694, 80.582740213523, |
| 390 | 87.548932384342, 90.151245551601, 92.593416370107, 93.674377224199, 100.0, |
| 391 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 21.0, |
| 392 | 21.822147651007, 22.268456375839, 22.926174496644, 23.255033557047, |
| 393 | 23.419463087248, 24.10067114094, 26.261744966443, 27.013422818792, |
| 394 | 27.812080536913, 28.0, 29.191489361702, 30.085106382979, 30.531914893617, |
| 395 | 31.053191489362, 31.22695035461, 31.599290780142, 32.145390070922, |
| 396 | 32.666666666667, 33.187943262411, 34.255319148936, 35.0, 35.298507462687, |
| 397 | 35.820895522388, 37.761194029851, 39.402985074627, 39.925373134328, |
| 398 | 40.373134328358, 41.492537313433, 42.462686567164, 42.835820895522, |
| 399 | 42.985074626866, 43.134328358209, 43.955223880597, 45.223880597015, |
| 400 | 46.567164179104, 48.582089552239, 51.492537313433, 55.0, 55.381355932203, |
| 401 | 55.871670702179, 57.778450363196, 59.249394673123, 59.848668280872, |
| 402 | 60.121065375303, 60.230024213075, 60.556900726392, 61.15617433414, |
| 403 | 66.168280871671, 66.331719128329, 69.32808716707, 69.709443099274, |
| 404 | 70.526634382567, 71.507263922518, 73.141646489104, 73.250605326877, |
| 405 | 74.122276029056, 77.663438256659, 79.134382566586, 82.185230024213, |
| 406 | 83.383777239709, 87.088377723971, 88.995157384988, 90.68401937046, |
| 407 | 99.56416464891, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 408 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 21.0, 28.0, |
| 409 | 28.383285302594, 28.948126801153, 29.230547550432, 29.371757925072, |
| 410 | 29.956772334294, 31.812680115274, 32.458213256484, 33.14409221902, |
| 411 | 33.305475504323, 34.273775216138, 35.0, 36.333333333333, 37.888888888889, |
| 412 | 38.407407407407, 39.518518518519, 41.148148148148, 42.703703703704, |
| 413 | 44.259259259259, 47.444444444444, 49.666666666667, 49.962962962963, |
| 414 | 50.481481481481, 52.407407407407, 54.037037037037, 54.555555555556, 55.0, |
| 415 | 55.941422594142, 56.757322175732, 57.071129707113, 57.196652719665, |
| 416 | 57.322175732218, 58.012552301255, 59.07949790795, 60.20920502092, |
| 417 | 61.903765690377, 64.351464435146, 67.301255230126, 67.740585774059, |
| 418 | 68.305439330544, 70.502092050209, 72.196652719665, 72.887029288703, |
| 419 | 73.200836820084, 73.326359832636, 73.702928870293, 74.393305439331, |
| 420 | 80.167364016736, 80.355648535565, 83.807531380753, 84.246861924686, |
| 421 | 85.188284518828, 86.317991631799, 88.200836820084, 88.326359832636, |
| 422 | 89.330543933054, 93.410041841004, 95.10460251046, 98.619246861925, 100.0, |
| 423 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 424 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, |
| 425 | 28.0, 28.95703125, 29.4765625, 30.2421875, 30.625, 30.81640625, 31.609375, |
| 426 | 34.125, 35.0, 37.098765432099, 37.592592592593, 40.555555555556, |
| 427 | 42.777777777778, 43.888888888889, 45.185185185185, 45.617283950617, |
| 428 | 46.543209876543, 47.901234567901, 49.197530864198, 50.493827160494, |
| 429 | 53.148148148148, 55.0, 55.234680573664, 55.645371577575, 57.170795306389, |
| 430 | 58.461538461538, 58.87222946545, 59.224250325945, 60.104302477184, |
| 431 | 60.867014341591, 61.16036505867, 61.277705345502, 61.395045632334, |
| 432 | 62.040417209909, 63.037809647979, 64.093872229465, 65.677966101695, |
| 433 | 67.966101694915, 70.723598435463, 71.134289439374, 71.662320730117, |
| 434 | 73.715775749674, 75.299869621904, 75.945241199478, 76.238591916558, |
| 435 | 76.35593220339, 76.707953063885, 77.35332464146, 82.750977835724, |
| 436 | 82.926988265971, 86.153846153846, 86.564537157757, 87.444589308996, |
| 437 | 88.500651890482, 90.26075619296, 90.378096479791, 91.316818774446, |
| 438 | 95.13037809648, 96.714471968709, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 439 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 440 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 441 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 442 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 443 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 444 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 445 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 446 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 447 | 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, |
| 448 | 100.0 } ; /* Variable: APTC_TRQ_PED_INV_MAP_PED_POS_MPV |
| 449 | * Referenced by: '<S85>/2D_Lookup_Table' |
| 450 | */ |
| 451 | |
| 452 | real_T APTC_TRQ_PED_INV_MAP_TRQ_STEPS[83] = { 0.0, 20.0, 55.0, 74.0, 102.0, |
| 453 | 116.0, 123.0, 152.0, 244.0, 276.0, 310.0, 318.0, 366.0, 402.0, 420.0, 441.0, |
| 454 | 448.0, 463.0, 485.0, 506.0, 527.0, 570.0, 600.0, 604.0, 611.0, 637.0, 659.0, |
| 455 | 666.0, 672.0, 687.0, 700.0, 705.0, 707.0, 709.0, 720.0, 737.0, 755.0, 782.0, |
| 456 | 821.0, 868.0, 875.0, 884.0, 919.0, 946.0, 957.0, 962.0, 964.0, 970.0, 981.0, |
| 457 | 1073.0, 1076.0, 1131.0, 1138.0, 1153.0, 1171.0, 1201.0, 1203.0, 1219.0, 1284.0, |
| 458 | 1311.0, 1367.0, 1389.0, 1457.0, 1492.0, 1523.0, 1686.0, 1694.0, 1700.0, 1715.0, |
| 459 | 1889.0, 1954.0, 2015.0, 2042.0, 2200.0, 2316.0, 2541.0, 2595.0, 2698.0, 2856.0, |
| 460 | 2870.0, 2940.0, 2952.0, 2964.0 } ; /* Variable: APTC_TRQ_PED_INV_MAP_TRQ_STEPS |
| 461 | * Referenced by: '<S85>/2D_Lookup_Table' |
| 462 | */ |
| 463 | |
| 464 | real_T APTC_TRQ_PED_TRQ_DATA_MPV[128] = { 0.0, 448.0, 570.0, 737.0, 981.0, |
| 465 | 1138.0, 1311.0, 1457.0, 0.0, 420.0, 527.0, 720.0, 970.0, 1131.0, 1311.0, |
| 466 | 1715.0, 0.0, 244.0, 506.0, 700.0, 964.0, 1171.0, 1523.0, 2316.0, 0.0, 152.0, |
| 467 | 485.0, 709.0, 957.0, 1201.0, 1686.0, 2595.0, 0.0, 116.0, 463.0, 720.0, 946.0, |
| 468 | 1219.0, 1954.0, 2870.0, 0.0, 74.0, 441.0, 705.0, 919.0, 1203.0, 2042.0, 2940.0, |
| 469 | 0.0, 20.0, 310.0, 666.0, 884.0, 1153.0, 2015.0, 2952.0, 0.0, 20.0, 123.0, |
| 470 | 637.0, 821.0, 1073.0, 1889.0, 2964.0, 0.0, 20.0, 20.0, 604.0, 755.0, 962.0, |
| 471 | 1700.0, 2856.0, 0.0, 20.0, 20.0, 366.0, 707.0, 875.0, 1492.0, 2698.0, 0.0, |
| 472 | 20.0, 20.0, 102.0, 659.0, 782.0, 1284.0, 2541.0, 0.0, 20.0, 20.0, 20.0, 611.0, |
| 473 | 687.0, 1076.0, 2200.0, 0.0, 20.0, 20.0, 20.0, 318.0, 600.0, 868.0, 1694.0, 0.0, |
| 474 | 20.0, 20.0, 20.0, 55.0, 402.0, 672.0, 1389.0, 0.0, 20.0, 20.0, 20.0, 20.0, |
| 475 | 276.0, 600.0, 1367.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } ;/* Variable: APTC_TRQ_PED_TRQ_DATA_MPV |
| 476 | * Referenced by: '<S83>/2-D Lookup Table' |
| 477 | */ |
| 478 | |
| 479 | real_T APTC_TRQ_PED_TRQ_ESPD_STEP_MPV[16] = { 500.0, 650.0, 885.0, 950.0, 1050.0, |
| 480 | 1120.0, 1240.0, 1360.0, 1475.0, 1590.0, 1710.0, 1830.0, 1950.0, 2150.0, 2300.0, |
| 481 | 2350.0 } ; /* Variable: APTC_TRQ_PED_TRQ_ESPD_STEP_MPV |
| 482 | * Referenced by: |
| 483 | * '<S83>/2-D Lookup Table' |
| 484 | * '<S85>/2D_Lookup_Table' |
| 485 | */ |
| 486 | |
| 487 | real_T APTC_TRQ_PED_TRQ_POS_STEP_MPV[8] = { 0.0, 7.0, 14.0, 21.0, 28.0, 35.0, |
| 488 | 55.0, 100.0 } ; /* Variable: APTC_TRQ_PED_TRQ_POS_STEP_MPV |
| 489 | * Referenced by: '<S83>/2-D Lookup Table' |
| 490 | */ |
| 491 | |
| 492 | real_T BRK_DEM_KD_DATA_MPV[8] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } ;/* Variable: BRK_DEM_KD_DATA_MPV |
| 493 | * Referenced by: '<S149>/1D_Lookup_Table' |
| 494 | */ |
| 495 | |
| 496 | real_T BRK_DEM_KI_DATA_MPV[8] = { -1.5, -1.5, -1.5, -1.5, -1.5, -1.5, -1.5, -1.5 |
| 497 | } ; /* Variable: BRK_DEM_KI_DATA_MPV |
| 498 | * Referenced by: '<S148>/1D_Lookup_Table' |
| 499 | */ |
| 500 | |
| 501 | real_T BRK_DEM_KP_DATA_MPV[8] = { -4.0, -4.0, -4.0, -4.0, -4.0, -4.0, -4.0, -4.0 |
| 502 | } ; /* Variable: BRK_DEM_KP_DATA_MPV |
| 503 | * Referenced by: '<S147>/1D_Lookup_Table' |
| 504 | */ |
| 505 | |
| 506 | real_T BRK_DEM_MASS_STEP_MPV[8] = { 0.0, 5000.0, 10000.0, 20000.0, 30000.0, |
| 507 | 40000.0, 50000.0, 54000.0 } ; /* Variable: BRK_DEM_MASS_STEP_MPV |
| 508 | * Referenced by: |
| 509 | * '<S147>/1D_Lookup_Table' |
| 510 | * '<S148>/1D_Lookup_Table' |
| 511 | * '<S149>/1D_Lookup_Table' |
| 512 | */ |
| 513 | |
| 514 | real_T BRK_GOV_FF_DECEL_RATE_DATA_MPV[32] = { 0.0, -0.39, -1.76, -3.13, -4.5, |
| 515 | -5.87, -7.24, -8.61, -9.98, -11.35, -12.72, -14.09, -15.46, -16.83, -18.2, |
| 516 | -19.57, 0.0, -0.12, -0.53, -0.94, -1.35, -1.76, -2.17, -2.58, -2.99, -3.41, |
| 517 | -3.82, -4.23, -4.64, -5.05, -5.46, -5.87 } ;/* Variable: BRK_GOV_FF_DECEL_RATE_DATA_MPV |
| 518 | * Referenced by: '<S199>/2D_Lookup_Table' |
| 519 | */ |
| 520 | |
| 521 | real_T BRK_GOV_FF_DECEL_RATE_STEP_MPV[16] = { -19.57, -18.2, -16.83, -15.46, |
| 522 | -14.09, -12.72, -11.35, -9.98, -8.61, -7.24, -5.87, -4.5, -3.13, -1.76, -0.39, |
| 523 | 0.0 } ; /* Variable: BRK_GOV_FF_DECEL_RATE_STEP_MPV |
| 524 | * Referenced by: |
| 525 | * '<S200>/2D_Lookup_Table' |
| 526 | * '<S201>/2D_Lookup_Table' |
| 527 | */ |
| 528 | |
| 529 | real_T BRK_GOV_FF_MASS_STEP_MPV[2] = { 9035.0, 36287.0 } ;/* Variable: BRK_GOV_FF_MASS_STEP_MPV |
| 530 | * Referenced by: |
| 531 | * '<S199>/2D_Lookup_Table' |
| 532 | * '<S200>/2D_Lookup_Table' |
| 533 | * '<S201>/2D_Lookup_Table' |
| 534 | */ |
| 535 | |
| 536 | real_T BRK_GOV_FF_PRESS_KPA_DATA_MPV[32] = { 1034.0, 965.0, 896.0, 827.0, 758.0, |
| 537 | 689.0, 621.0, 552.0, 483.0, 414.0, 345.0, 276.0, 207.0, 138.0, 69.0, 0.0, |
| 538 | 2585.0, 2413.0, 2240.0, 2068.0, 1895.0, 1723.0, 1553.0, 1380.0, 1208.0, 1035.0, |
| 539 | 863.0, 690.0, 518.0, 345.0, 173.0, 0.0 } ;/* Variable: BRK_GOV_FF_PRESS_KPA_DATA_MPV |
| 540 | * Referenced by: |
| 541 | * '<S200>/2D_Lookup_Table' |
| 542 | * '<S201>/2D_Lookup_Table' |
| 543 | */ |
| 544 | |
| 545 | real_T BRK_GOV_FF_PRESS_KPA_STEP_MPV[16] = { 0.0, 69.0, 138.0, 207.0, 276.0, |
| 546 | 345.0, 414.0, 483.0, 552.0, 621.0, 689.0, 758.0, 827.0, 896.0, 965.0, 1034.0 } |
| 547 | ; /* Variable: BRK_GOV_FF_PRESS_KPA_STEP_MPV |
| 548 | * Referenced by: '<S199>/2D_Lookup_Table' |
| 549 | */ |
| 550 | |
| 551 | real_T Curvature_FF_Gain = 5.7; /* Variable: Curvature_FF_Gain |
| 552 | * Referenced by: '<S281>/FeedforwardGain' |
| 553 | */ |
| 554 | real_T DISTANCE_M = 200.0; /* Variable: DISTANCE_M |
| 555 | * Referenced by: '<S81>/DISTANCE_M' |
| 556 | */ |
| 557 | real_T Lateral_Control_Curvature_Limit = 0.5;/* Variable: Lateral_Control_Curvature_Limit |
| 558 | * Referenced by: |
| 559 | * '<S281>/Constant3' |
| 560 | * '<S281>/Constant5' |
| 561 | */ |
| 562 | real_T Lateral_Control_D = 0.1; /* Variable: Lateral_Control_D |
| 563 | * Referenced by: '<S307>/Derivative Gain' |
| 564 | */ |
| 565 | real_T Lateral_Control_Error_Limit = 0.1;/* Variable: Lateral_Control_Error_Limit |
| 566 | * Referenced by: |
| 567 | * '<S281>/Constant' |
| 568 | * '<S281>/Constant1' |
| 569 | */ |
| 570 | real_T Lateral_Control_Error_Rate_Limit = 0.05;/* Variable: Lateral_Control_Error_Rate_Limit |
| 571 | * Referenced by: |
| 572 | * '<S281>/Constant10' |
| 573 | * '<S281>/Constant7' |
| 574 | * '<S281>/Constant8' |
| 575 | * '<S281>/Constant9' |
| 576 | */ |
| 577 | real_T Lateral_Control_I = 0.0; /* Variable: Lateral_Control_I |
| 578 | * Referenced by: '<S307>/Integral Gain' |
| 579 | */ |
| 580 | real_T Lateral_Control_P = 0.5; /* Variable: Lateral_Control_P |
| 581 | * Referenced by: |
| 582 | * '<S281>/PGain' |
| 583 | * '<S307>/Proportional Gain' |
| 584 | */ |
| 585 | real_T Lateral_Control_Pole = 0.98; /* Variable: Lateral_Control_Pole |
| 586 | * Referenced by: '<S311>/GainPole' |
| 587 | */ |
| 588 | real_T Lateral_Control_Rate_Limit_APV = 0.05;/* Variable: Lateral_Control_Rate_Limit_APV |
| 589 | * Referenced by: '<S310>/Constant' |
| 590 | */ |
| 591 | real_T Lateral_Control_YawRate_Limit = 1.0;/* Variable: Lateral_Control_YawRate_Limit |
| 592 | * Referenced by: |
| 593 | * '<S281>/Constant2' |
| 594 | * '<S281>/Constant4' |
| 595 | */ |
| 596 | real_T Lateral_Control_Zero = 0.99; /* Variable: Lateral_Control_Zero |
| 597 | * Referenced by: '<S311>/GainZero' |
| 598 | */ |
| 599 | real_T PROPB_REAX_1_E4_DESIRED_POSITION_APV = 0.0;/* Variable: PROPB_REAX_1_E4_DESIRED_POSITION_APV |
| 600 | * Referenced by: '<S994>/Constant7' |
| 601 | */ |
| 602 | real_T REAX_OFFSET_APV = 0.0; /* Variable: REAX_OFFSET_APV |
| 603 | * Referenced by: |
| 604 | * '<S80>/Constant' |
| 605 | * '<S280>/ReAX Offset' |
| 606 | * '<S281>/Constant6' |
| 607 | */ |
| 608 | real_T STANLEY_GAIN_APV = 0.05; /* Variable: STANLEY_GAIN_APV |
| 609 | * Referenced by: '<S280>/StanleySteeringControlGain' |
| 610 | */ |
| 611 | real_T STEERCTRL_WHEEL_ANGLE_DATA_MPV[72] = { -800.02001953125, -780.02899169922, |
| 612 | -760.03399658203, -740.0, -720.0, -700.00402832031, -680.0, -660.01397705078, |
| 613 | -640.01898193359, -620.02398681641, -600.02001953125, -580.03399658203, |
| 614 | -560.03900146484, -540.0, -520.00402832031, -500.00900268555, -480.01400756836, |
| 615 | -460.01901245117, -440.02398681641, -420.01998901367, -400.03399658203, |
| 616 | -380.03900146484, -360.0, -340.00399780273, -320.00900268555, -300.01400756836, |
| 617 | -280.01901245117, -260.02398681641, -240.02900695801, -220.03399658203, |
| 618 | -200.03900146484, -180.0, -160.00399780273, -140.00900268555, -120.01399993896, |
| 619 | -100.01899719238, -80.024002075195, -60.028999328613, -40.034000396729, |
| 620 | 0.52700001001358, 29.969999313354, 50.00899887085, 69.959999084473, |
| 621 | 89.949996948242, 109.99500274658, 129.99000549316, 149.98500061035, |
| 622 | 170.0240020752, 189.97500610352, 209.9700012207, 229.96499633789, |
| 623 | 249.96000671387, 270.0, 289.99499511719, 309.98999023438, 329.98498535156, |
| 624 | 349.98001098633, 369.97500610352, 390.01400756836, 410.00900268555, 450.0, |
| 625 | 470.0299987793, 489.98999023438, 509.98498535156, 529.97998046875, |
| 626 | 549.97497558594, 569.96997070313, 589.96502685547, 610.21997070313, 630.0, |
| 627 | 650.25, 670.0 } ; /* Variable: STEERCTRL_WHEEL_ANGLE_DATA_MPV |
| 628 | * Referenced by: '<S276>/1D_Lookup_Table' |
| 629 | */ |
| 630 | |
| 631 | real_T STEERCTRL_WHEEL_ANGLE_STEP_MPV[72] = { -46.0, -44.5, -43.0, -42.0, -40.0, |
| 632 | -39.0, -37.5, -36.5, -35.0, -34.0, -33.0, -31.5, -30.5, -29.0, -28.0, -26.5, |
| 633 | -25.5, -24.5, -23.5, -22.0, -21.0, -20.0, -19.0, -17.5, -16.5, -15.5, -14.0, |
| 634 | -13.0, -12.0, -11.0, -10.0, -8.5, -7.5, -6.5, -5.0, -4.0, -3.0, -2.0, -1.0, |
| 635 | 0.0, 1.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, |
| 636 | 15.0, 16.0, 17.0, 18.5, 19.5, 20.5, 21.5, 23.5, 24.5, 25.5, 26.5, 27.5, 28.5, |
| 637 | 29.0, 30.0, 31.0, 31.5, 32.5, 33.0 } ;/* Variable: STEERCTRL_WHEEL_ANGLE_STEP_MPV |
| 638 | * Referenced by: '<S276>/1D_Lookup_Table' |
| 639 | */ |
| 640 | |
| 641 | real_T TQ_DEM_GEAR_RATIO_STEP_MPV[8] = { 0.0, 0.2, 4.0, 8.0, 10.0, 16.0, 18.0, |
| 642 | 20.0 } ; /* Variable: TQ_DEM_GEAR_RATIO_STEP_MPV |
| 643 | * Referenced by: |
| 644 | * '<S241>/2D_Lookup_Table' |
| 645 | * '<S242>/2D_Lookup_Table' |
| 646 | * '<S243>/2D_Lookup_Table' |
| 647 | */ |
| 648 | |
| 649 | real_T TQ_DEM_KD_DATA_MPV[64] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, |
| 650 | 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, |
| 651 | 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, |
| 652 | 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, |
| 653 | 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } ;/* Variable: TQ_DEM_KD_DATA_MPV |
| 654 | * Referenced by: '<S243>/2D_Lookup_Table' |
| 655 | */ |
| 656 | |
| 657 | real_T TQ_DEM_KI_DATA_MPV[64] = { 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, |
| 658 | 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, |
| 659 | 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, |
| 660 | 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, |
| 661 | 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7 } ;/* Variable: TQ_DEM_KI_DATA_MPV |
| 662 | * Referenced by: '<S242>/2D_Lookup_Table' |
| 663 | */ |
| 664 | |
| 665 | real_T TQ_DEM_KP_DATA_MPV[64] = { 4.0, 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, |
| 666 | 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, |
| 667 | 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, |
| 668 | 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, |
| 669 | 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0 } ;/* Variable: TQ_DEM_KP_DATA_MPV |
| 670 | * Referenced by: '<S241>/2D_Lookup_Table' |
| 671 | */ |
| 672 | |
| 673 | real_T TQ_DEM_MASS_STEP_MPV[8] = { 0.0, 5000.0, 10000.0, 20000.0, 30000.0, |
| 674 | 40000.0, 50000.0, 54000.0 } ; /* Variable: TQ_DEM_MASS_STEP_MPV |
| 675 | * Referenced by: |
| 676 | * '<S241>/2D_Lookup_Table' |
| 677 | * '<S242>/2D_Lookup_Table' |
| 678 | * '<S243>/2D_Lookup_Table' |
| 679 | */ |
| 680 | |
| 681 | real_T UndersteerCorection = 0.5; /* Variable: UndersteerCorection |
| 682 | * Referenced by: '<S281>/UndersteerCorrection' |
| 683 | */ |
| 684 | real_T VSPD_TARGET_KPH_APV = 0.0; /* Variable: VSPD_TARGET_KPH_APV |
| 685 | * Referenced by: '<S81>/VSPD_TARGET_KPH_APV' |
| 686 | */ |
| 687 | real_T YAW_RATE_OFFSET_APV = -0.0066; /* Variable: YAW_RATE_OFFSET_APV |
| 688 | * Referenced by: '<S281>/YAW_RATE_OFFSET_APV' |
| 689 | */ |
| 690 | real_T Yaw_Rate_FF_Gain = 0.1; /* Variable: Yaw_Rate_FF_Gain |
| 691 | * Referenced by: '<S281>/RateFeedbackGain' |
| 692 | */ |
| 693 | ENUM_AUTONOMOUS_MODE_T AUTONOMOUS_MODE_SELECTOR_APV = |
| 694 | ENUM_AUTONOMOUS_MODE_T_AUTO; /* Variable: AUTONOMOUS_MODE_SELECTOR_APV |
| 695 | * Referenced by: '<S76>/AUTONOMOUS_MODE_SELECTOR_APV' |
| 696 | */ |
| 697 | ENUM_CAN_RX_T CANR_PROPB_XPR_1_50_CHANNEL_APV = ENUM_CAN_RX_T_RX_CAN_3;/* Variable: CANR_PROPB_XPR_1_50_CHANNEL_APV |
| 698 | * Referenced by: '<S446>/Constant' |
| 699 | */ |
| 700 | ENUM_CAN_RX_T PROPB_REAX_CHANNEL_APV = ENUM_CAN_RX_T_RX_CAN_2;/* Variable: PROPB_REAX_CHANNEL_APV |
| 701 | * Referenced by: |
| 702 | * '<S444>/Constant' |
| 703 | * '<S445>/Constant' |
| 704 | * '<S466>/Constant3' |
| 705 | */ |
| 706 | ENUM_LAT_STEER_SOURCE_T LAT_STEER_SRC_SELECTOR_APV = |
| 707 | ENUM_LAT_STEER_SOURCE_T_PIC_HARIS; /* Variable: LAT_STEER_SRC_SELECTOR_APV |
| 708 | * Referenced by: '<S80>/LAT_STEER_SRC_SELECTOR_APV' |
| 709 | */ |
| 710 | ENUM_LONG_SPEED_DEMAND_SOURCE_T LONG_SPEED_SRC_SELECTOR_APV = |
| 711 | ENUM_LONG_SPEED_DEMAND_SOURCE_T_WAYPOINTS;/* Variable: LONG_SPEED_SRC_SELECTOR_APV |
| 712 | * Referenced by: |
| 713 | * '<S80>/LONG_SPEED_SRC_SELECTOR_APV' |
| 714 | * '<S81>/LONG_SPEED_SRC_SELECTOR_APV' |
| 715 | */ |
| 716 | ENUM_REAX_OPERATION_MODE_T PROPB_REAX_1_E4_DESIRED_OPMODE_APV = |
| 717 | ENUM_REAX_OPERATION_MODE_T_POSITION_CTRL_MODE;/* Variable: PROPB_REAX_1_E4_DESIRED_OPMODE_APV |
| 718 | * Referenced by: '<S977>/Constant6' |
| 719 | */ |
| 720 | ENUM_STEERING_POS_SIGNAL_SOURCE_T PROPB_REAX_1_E4_DES_POS_SIG_SRC_APV = |
| 721 | ENUM_STEERING_POS_SIGNAL_SOURCE_T_ESTIMATION;/* Variable: PROPB_REAX_1_E4_DES_POS_SIG_SRC_APV |
| 722 | * Referenced by: '<S994>/Constant1' |
| 723 | */ |
| 724 | ENUM_SWITCH_T RATE_LIMITER_ENABLE_APV = ENUM_SWITCH_T_ON;/* Variable: RATE_LIMITER_ENABLE_APV |
| 725 | * Referenced by: '<S310>/RATE_LIMITER_ENABLE_APV' |
| 726 | */ |
| 727 | |
| 728 | /* Block signals (default storage) */ |
| 729 | B_L4_MABX_T L4_MABX_B; |
| 730 | |
| 731 | /* Block states (default storage) */ |
| 732 | DW_L4_MABX_T L4_MABX_DW; |
| 733 | |
| 734 | /* Previous zero-crossings (trigger) states */ |
| 735 | PrevZCX_L4_MABX_T L4_MABX_PrevZCX; |
| 736 | |
| 737 | /* Real-time model */ |
| 738 | RT_MODEL_L4_MABX_T L4_MABX_M_; |
| 739 | RT_MODEL_L4_MABX_T *const L4_MABX_M = &L4_MABX_M_; |
| 740 | |
| 741 | /* Forward declaration for local functions */ |
| 742 | static int32_T safe_cast_to_ENUM_XPR_CONTROL_M(int32_T input); |
| 743 | static int32_T safe_cast_to_ENUM_XPR_ERROR_STA(int32_T input); |
| 744 | static void L4_MABX_enter_atomic_INITIAL(void); |
| 745 | static void L4_MABX_Calculate_abc(void); |
| 746 | static void L4_MABX_CalculateAlternate_abc(void); |
| 747 | static void L4_MABX_CalculateAcceleration34(void); |
| 748 | static int32_T safe_cast_to_ENUM_CAN_STATUS_DI(int32_T input); |
| 749 | |
| 750 | /* Lookup Binary Search Utility BINARYSEARCH_real_T */ |
| 751 | void BINARYSEARCH_real_T(uint32_T *piLeft, uint32_T *piRght, real_T u, const |
| 752 | real_T *pData, uint32_T iHi) |
| 753 | { |
| 754 | /* Find the location of current input value in the data table. */ |
| 755 | *piLeft = 0U; |
| 756 | *piRght = iHi; |
| 757 | if (u <= pData[0] ) { |
| 758 | /* Less than or equal to the smallest point in the table. */ |
| 759 | *piRght = 0U; |
| 760 | } else if (u >= pData[iHi] ) { |
| 761 | /* Greater than or equal to the largest point in the table. */ |
| 762 | *piLeft = iHi; |
| 763 | } else { |
| 764 | uint32_T i; |
| 765 | |
| 766 | /* Do a binary search. */ |
| 767 | while (( *piRght - *piLeft ) > 1U ) { |
| 768 | /* Get the average of the left and right indices using to Floor rounding. */ |
| 769 | i = (*piLeft + *piRght) >> 1; |
| 770 | |
| 771 | /* Move either the right index or the left index so that */ |
| 772 | /* LeftDataPoint <= CurrentValue < RightDataPoint */ |
| 773 | if (u < pData[i] ) { |
| 774 | *piRght = i; |
| 775 | } else { |
| 776 | *piLeft = i; |
| 777 | } |
| 778 | } |
| 779 | } |
| 780 | } |
| 781 | |
| 782 | /* Lookup Utility LookUp_real_T_real_T */ |
| 783 | void LookUp_real_T_real_T(real_T *pY, const real_T *pYData, real_T u, const |
| 784 | real_T *pUData, uint32_T iHi) |
| 785 | { |
| 786 | uint32_T iLeft; |
| 787 | uint32_T iRght; |
| 788 | BINARYSEARCH_real_T( &(iLeft), &(iRght), u, pUData, iHi); |
| 789 | |
| 790 | { |
| 791 | real_T lambda; |
| 792 | if (pUData[iRght] > pUData[iLeft] ) { |
| 793 | real_T num; |
| 794 | real_T den; |
| 795 | den = pUData[iRght]; |
| 796 | den -= pUData[iLeft]; |
| 797 | num = u; |
| 798 | num -= pUData[iLeft]; |
| 799 | lambda = num / den; |
| 800 | } else { |
| 801 | lambda = 0.0; |
| 802 | } |
| 803 | |
| 804 | { |
| 805 | real_T yLeftCast; |
| 806 | real_T yRghtCast; |
| 807 | yLeftCast = pYData[iLeft]; |
| 808 | yRghtCast = pYData[iRght]; |
| 809 | yLeftCast += lambda * ( yRghtCast - yLeftCast ); |
| 810 | (*pY) = yLeftCast; |
| 811 | } |
| 812 | } |
| 813 | } |
| 814 | |
| 815 | real_T look1_binlcapw(real_T u0, const real_T bp0[], const real_T table[], |
| 816 | uint32_T maxIndex) |
| 817 | { |
| 818 | real_T y; |
| 819 | real_T frac; |
| 820 | uint32_T iRght; |
| 821 | uint32_T iLeft; |
| 822 | uint32_T bpIdx; |
| 823 | |
| 824 | /* Lookup 1-D |
| 825 | Search method: 'binary' |
| 826 | Use previous index: 'off' |
| 827 | Interpolation method: 'Linear point-slope' |
| 828 | Extrapolation method: 'Clip' |
| 829 | Use last breakpoint for index at or above upper limit: 'on' |
| 830 | Remove protection against out-of-range input in generated code: 'off' |
| 831 | */ |
| 832 | /* Prelookup - Index and Fraction |
| 833 | Index Search method: 'binary' |
| 834 | Extrapolation method: 'Clip' |
| 835 | Use previous index: 'off' |
| 836 | Use last breakpoint for index at or above upper limit: 'on' |
| 837 | Remove protection against out-of-range input in generated code: 'off' |
| 838 | */ |
| 839 | if (u0 <= bp0[0U]) { |
| 840 | iLeft = 0U; |
| 841 | frac = 0.0; |
| 842 | } else if (u0 < bp0[maxIndex]) { |
| 843 | /* Binary Search */ |
| 844 | bpIdx = maxIndex >> 1U; |
| 845 | iLeft = 0U; |
| 846 | iRght = maxIndex; |
| 847 | while (iRght - iLeft > 1U) { |
| 848 | if (u0 < bp0[bpIdx]) { |
| 849 | iRght = bpIdx; |
| 850 | } else { |
| 851 | iLeft = bpIdx; |
| 852 | } |
| 853 | |
| 854 | bpIdx = (iRght + iLeft) >> 1U; |
| 855 | } |
| 856 | |
| 857 | frac = (u0 - bp0[iLeft]) / (bp0[iLeft + 1U] - bp0[iLeft]); |
| 858 | } else { |
| 859 | iLeft = maxIndex; |
| 860 | frac = 0.0; |
| 861 | } |
| 862 | |
| 863 | /* Interpolation 1-D |
| 864 | Interpolation method: 'Linear point-slope' |
| 865 | Use last breakpoint for index at or above upper limit: 'on' |
| 866 | Overflow mode: 'portable wrapping' |
| 867 | */ |
| 868 | if (iLeft == maxIndex) { |
| 869 | y = table[iLeft]; |
| 870 | } else { |
| 871 | y = (table[iLeft + 1U] - table[iLeft]) * frac + table[iLeft]; |
| 872 | } |
| 873 | |
| 874 | return y; |
| 875 | } |
| 876 | |
| 877 | real_T look2_binlcapw(real_T u0, real_T u1, const real_T bp0[], const real_T |
| 878 | bp1[], const real_T table[], const uint32_T maxIndex[], |
| 879 | uint32_T stride) |
| 880 | { |
| 881 | real_T y; |
| 882 | real_T frac; |
| 883 | uint32_T bpIndices[2]; |
| 884 | real_T fractions[2]; |
| 885 | real_T yR_1d; |
| 886 | uint32_T iRght; |
| 887 | uint32_T bpIdx; |
| 888 | uint32_T iLeft; |
| 889 | |
| 890 | /* Lookup 2-D |
| 891 | Search method: 'binary' |
| 892 | Use previous index: 'off' |
| 893 | Interpolation method: 'Linear point-slope' |
| 894 | Extrapolation method: 'Clip' |
| 895 | Use last breakpoint for index at or above upper limit: 'on' |
| 896 | Remove protection against out-of-range input in generated code: 'off' |
| 897 | */ |
| 898 | /* Prelookup - Index and Fraction |
| 899 | Index Search method: 'binary' |
| 900 | Extrapolation method: 'Clip' |
| 901 | Use previous index: 'off' |
| 902 | Use last breakpoint for index at or above upper limit: 'on' |
| 903 | Remove protection against out-of-range input in generated code: 'off' |
| 904 | */ |
| 905 | if (u0 <= bp0[0U]) { |
| 906 | iLeft = 0U; |
| 907 | frac = 0.0; |
| 908 | } else if (u0 < bp0[maxIndex[0U]]) { |
| 909 | /* Binary Search */ |
| 910 | bpIdx = maxIndex[0U] >> 1U; |
| 911 | iLeft = 0U; |
| 912 | iRght = maxIndex[0U]; |
| 913 | while (iRght - iLeft > 1U) { |
| 914 | if (u0 < bp0[bpIdx]) { |
| 915 | iRght = bpIdx; |
| 916 | } else { |
| 917 | iLeft = bpIdx; |
| 918 | } |
| 919 | |
| 920 | bpIdx = (iRght + iLeft) >> 1U; |
| 921 | } |
| 922 | |
| 923 | frac = (u0 - bp0[iLeft]) / (bp0[iLeft + 1U] - bp0[iLeft]); |
| 924 | } else { |
| 925 | iLeft = maxIndex[0U]; |
| 926 | frac = 0.0; |
| 927 | } |
| 928 | |
| 929 | fractions[0U] = frac; |
| 930 | bpIndices[0U] = iLeft; |
| 931 | |
| 932 | /* Prelookup - Index and Fraction |
| 933 | Index Search method: 'binary' |
| 934 | Extrapolation method: 'Clip' |
| 935 | Use previous index: 'off' |
| 936 | Use last breakpoint for index at or above upper limit: 'on' |
| 937 | Remove protection against out-of-range input in generated code: 'off' |
| 938 | */ |
| 939 | if (u1 <= bp1[0U]) { |
| 940 | iLeft = 0U; |
| 941 | frac = 0.0; |
| 942 | } else if (u1 < bp1[maxIndex[1U]]) { |
| 943 | /* Binary Search */ |
| 944 | bpIdx = maxIndex[1U] >> 1U; |
| 945 | iLeft = 0U; |
| 946 | iRght = maxIndex[1U]; |
| 947 | while (iRght - iLeft > 1U) { |
| 948 | if (u1 < bp1[bpIdx]) { |
| 949 | iRght = bpIdx; |
| 950 | } else { |
| 951 | iLeft = bpIdx; |
| 952 | } |
| 953 | |
| 954 | bpIdx = (iRght + iLeft) >> 1U; |
| 955 | } |
| 956 | |
| 957 | frac = (u1 - bp1[iLeft]) / (bp1[iLeft + 1U] - bp1[iLeft]); |
| 958 | } else { |
| 959 | iLeft = maxIndex[1U]; |
| 960 | frac = 0.0; |
| 961 | } |
| 962 | |
| 963 | /* Interpolation 2-D |
| 964 | Interpolation method: 'Linear point-slope' |
| 965 | Use last breakpoint for index at or above upper limit: 'on' |
| 966 | Overflow mode: 'portable wrapping' |
| 967 | */ |
| 968 | bpIdx = iLeft * stride + bpIndices[0U]; |
| 969 | if (bpIndices[0U] == maxIndex[0U]) { |
| 970 | y = table[bpIdx]; |
| 971 | } else { |
| 972 | y = (table[bpIdx + 1U] - table[bpIdx]) * fractions[0U] + table[bpIdx]; |
| 973 | } |
| 974 | |
| 975 | if (iLeft == maxIndex[1U]) { |
| 976 | } else { |
| 977 | bpIdx += stride; |
| 978 | if (bpIndices[0U] == maxIndex[0U]) { |
| 979 | yR_1d = table[bpIdx]; |
| 980 | } else { |
| 981 | yR_1d = (table[bpIdx + 1U] - table[bpIdx]) * fractions[0U] + table[bpIdx]; |
| 982 | } |
| 983 | |
| 984 | y += (yR_1d - y) * frac; |
| 985 | } |
| 986 | |
| 987 | return y; |
| 988 | } |
| 989 | |
| 990 | real_T look1_binlxpw(real_T u0, const real_T bp0[], const real_T table[], |
| 991 | uint32_T maxIndex) |
| 992 | { |
| 993 | real_T frac; |
| 994 | uint32_T iRght; |
| 995 | uint32_T iLeft; |
| 996 | uint32_T bpIdx; |
| 997 | |
| 998 | /* Lookup 1-D |
| 999 | Search method: 'binary' |
| 1000 | Use previous index: 'off' |
| 1001 | Interpolation method: 'Linear point-slope' |
| 1002 | Extrapolation method: 'Linear' |
| 1003 | Use last breakpoint for index at or above upper limit: 'off' |
| 1004 | Remove protection against out-of-range input in generated code: 'off' |
| 1005 | */ |
| 1006 | /* Prelookup - Index and Fraction |
| 1007 | Index Search method: 'binary' |
| 1008 | Extrapolation method: 'Linear' |
| 1009 | Use previous index: 'off' |
| 1010 | Use last breakpoint for index at or above upper limit: 'off' |
| 1011 | Remove protection against out-of-range input in generated code: 'off' |
| 1012 | */ |
| 1013 | if (u0 <= bp0[0U]) { |
| 1014 | iLeft = 0U; |
| 1015 | frac = (u0 - bp0[0U]) / (bp0[1U] - bp0[0U]); |
| 1016 | } else if (u0 < bp0[maxIndex]) { |
| 1017 | /* Binary Search */ |
| 1018 | bpIdx = maxIndex >> 1U; |
| 1019 | iLeft = 0U; |
| 1020 | iRght = maxIndex; |
| 1021 | while (iRght - iLeft > 1U) { |
| 1022 | if (u0 < bp0[bpIdx]) { |
| 1023 | iRght = bpIdx; |
| 1024 | } else { |
| 1025 | iLeft = bpIdx; |
| 1026 | } |
| 1027 | |
| 1028 | bpIdx = (iRght + iLeft) >> 1U; |
| 1029 | } |
| 1030 | |
| 1031 | frac = (u0 - bp0[iLeft]) / (bp0[iLeft + 1U] - bp0[iLeft]); |
| 1032 | } else { |
| 1033 | iLeft = maxIndex - 1U; |
| 1034 | frac = (u0 - bp0[maxIndex - 1U]) / (bp0[maxIndex] - bp0[maxIndex - 1U]); |
| 1035 | } |
| 1036 | |
| 1037 | /* Interpolation 1-D |
| 1038 | Interpolation method: 'Linear point-slope' |
| 1039 | Use last breakpoint for index at or above upper limit: 'off' |
| 1040 | Overflow mode: 'portable wrapping' |
| 1041 | */ |
| 1042 | return (table[iLeft + 1U] - table[iLeft]) * frac + table[iLeft]; |
| 1043 | } |
| 1044 | |
| 1045 | /* |
| 1046 | * Output and update for atomic system: |
| 1047 | * '<S82>/If_Then_Else' |
| 1048 | * '<S83>/If_Then_Else' |
| 1049 | * '<S83>/If_Then_Else1' |
| 1050 | * '<S89>/If_Then_Else' |
| 1051 | * '<S89>/If_Then_Else1' |
| 1052 | * '<S90>/If_Then_Else' |
| 1053 | * '<S90>/If_Then_Else1' |
| 1054 | * '<S121>/If_Then_Else' |
| 1055 | * '<S124>/If_Then_Else' |
| 1056 | * '<S126>/If_Then_Else' |
| 1057 | * ... |
| 1058 | */ |
| 1059 | void L4_MABX_If_Then_Else(boolean_T rtu_If, real_T rtu_Then, real_T rtu_Else, |
| 1060 | B_If_Then_Else_L4_MABX_T *localB) |
| 1061 | { |
| 1062 | /* Switch: '<S86>/Switch' */ |
| 1063 | if (rtu_If) { |
| 1064 | localB->Switch = rtu_Then; |
| 1065 | } else { |
| 1066 | localB->Switch = rtu_Else; |
| 1067 | } |
| 1068 | |
| 1069 | /* End of Switch: '<S86>/Switch' */ |
| 1070 | } |
| 1071 | |
| 1072 | /* |
| 1073 | * System initialize for enable system: |
| 1074 | * '<S112>/Calculate_D_term' |
| 1075 | * '<S150>/Calculate_D_term' |
| 1076 | * '<S244>/Calculate_D_term' |
| 1077 | */ |
| 1078 | void L4_MA_Calculate_D_term_Init(B_Calculate_D_term_L4_MABX_T *localB, |
| 1079 | DW_Calculate_D_term_L4_MABX_T *localDW, P_Calculate_D_term_L4_MABX_T *localP) |
| 1080 | { |
| 1081 | /* InitializeConditions for UnitDelay: '<S121>/Unit_Delay1' */ |
| 1082 | localDW->Unit_Delay1_DSTATE = localP->Unit_Delay1_InitialCondition; |
| 1083 | |
| 1084 | /* InitializeConditions for UnitDelay: '<S121>/Unit_Delay2' */ |
| 1085 | localDW->Unit_Delay2_DSTATE = localP->Unit_Delay2_InitialCondition; |
| 1086 | |
| 1087 | /* InitializeConditions for UnitDelay: '<S122>/FixPt Unit Delay2' */ |
| 1088 | localDW->FixPtUnitDelay2_DSTATE = localP->FixPtUnitDelay2_InitialConditio; |
| 1089 | |
| 1090 | /* InitializeConditions for UnitDelay: '<S122>/FixPt Unit Delay1' */ |
| 1091 | localDW->FixPtUnitDelay1_DSTATE = localP->FixPtUnitDelay1_InitialConditio; |
| 1092 | |
| 1093 | /* SystemInitialize for Outport: '<S116>/GPID_d_term' */ |
| 1094 | localB->Subtract = localP->GPID_d_term_Y0; |
| 1095 | } |
| 1096 | |
| 1097 | /* |
| 1098 | * System reset for enable system: |
| 1099 | * '<S112>/Calculate_D_term' |
| 1100 | * '<S150>/Calculate_D_term' |
| 1101 | * '<S244>/Calculate_D_term' |
| 1102 | */ |
| 1103 | void L4_M_Calculate_D_term_Reset(DW_Calculate_D_term_L4_MABX_T *localDW, |
| 1104 | P_Calculate_D_term_L4_MABX_T *localP) |
| 1105 | { |
| 1106 | /* InitializeConditions for UnitDelay: '<S121>/Unit_Delay1' */ |
| 1107 | localDW->Unit_Delay1_DSTATE = localP->Unit_Delay1_InitialCondition; |
| 1108 | |
| 1109 | /* InitializeConditions for UnitDelay: '<S121>/Unit_Delay2' */ |
| 1110 | localDW->Unit_Delay2_DSTATE = localP->Unit_Delay2_InitialCondition; |
| 1111 | |
| 1112 | /* InitializeConditions for UnitDelay: '<S122>/FixPt Unit Delay2' */ |
| 1113 | localDW->FixPtUnitDelay2_DSTATE = localP->FixPtUnitDelay2_InitialConditio; |
| 1114 | |
| 1115 | /* InitializeConditions for UnitDelay: '<S122>/FixPt Unit Delay1' */ |
| 1116 | localDW->FixPtUnitDelay1_DSTATE = localP->FixPtUnitDelay1_InitialConditio; |
| 1117 | } |
| 1118 | |
| 1119 | /* |
| 1120 | * Disable for enable system: |
| 1121 | * '<S112>/Calculate_D_term' |
| 1122 | * '<S150>/Calculate_D_term' |
| 1123 | * '<S244>/Calculate_D_term' |
| 1124 | */ |
| 1125 | void L4_Calculate_D_term_Disable(B_Calculate_D_term_L4_MABX_T *localB, |
| 1126 | DW_Calculate_D_term_L4_MABX_T *localDW, P_Calculate_D_term_L4_MABX_T *localP) |
| 1127 | { |
| 1128 | /* Disable for Outport: '<S116>/GPID_d_term' */ |
| 1129 | localB->Subtract = localP->GPID_d_term_Y0; |
| 1130 | localDW->Calculate_D_term_MODE = false; |
| 1131 | } |
| 1132 | |
| 1133 | /* |
| 1134 | * Start for enable system: |
| 1135 | * '<S112>/Calculate_D_term' |
| 1136 | * '<S150>/Calculate_D_term' |
| 1137 | * '<S244>/Calculate_D_term' |
| 1138 | */ |
| 1139 | void L4_M_Calculate_D_term_Start(DW_Calculate_D_term_L4_MABX_T *localDW) |
| 1140 | { |
| 1141 | localDW->Calculate_D_term_MODE = false; |
| 1142 | } |
| 1143 | |
| 1144 | /* |
| 1145 | * Outputs for enable system: |
| 1146 | * '<S112>/Calculate_D_term' |
| 1147 | * '<S150>/Calculate_D_term' |
| 1148 | * '<S244>/Calculate_D_term' |
| 1149 | */ |
| 1150 | void L4_MABX_Calculate_D_term(boolean_T rtu_Enable, real_T rtu_GPID_Kd, real_T |
| 1151 | rtu_GPID_dT, boolean_T rtu_F_GPID_reset_gov, real_T rtu_GPID_control_error, |
| 1152 | real_T rtu_GPID_T_filt_d, B_Calculate_D_term_L4_MABX_T *localB, |
| 1153 | DW_Calculate_D_term_L4_MABX_T *localDW, P_Calculate_D_term_L4_MABX_T *localP) |
| 1154 | { |
| 1155 | real_T maxV; |
| 1156 | real_T u1; |
| 1157 | real_T u2; |
| 1158 | |
| 1159 | /* Outputs for Enabled SubSystem: '<S112>/Calculate_D_term' incorporates: |
| 1160 | * EnablePort: '<S116>/Enable' |
| 1161 | */ |
| 1162 | if (rtu_Enable) { |
| 1163 | if (!localDW->Calculate_D_term_MODE) { |
| 1164 | L4_M_Calculate_D_term_Reset(localDW, localP); |
| 1165 | localDW->Calculate_D_term_MODE = true; |
| 1166 | } |
| 1167 | |
| 1168 | /* UnitDelay: '<S121>/Unit_Delay1' */ |
| 1169 | localB->Unit_Delay1 = localDW->Unit_Delay1_DSTATE; |
| 1170 | |
| 1171 | /* Logic: '<S121>/Logical Operator' */ |
| 1172 | localB->LogicalOperator = (rtu_F_GPID_reset_gov || localB->Unit_Delay1); |
| 1173 | |
| 1174 | /* MinMax: '<S121>/MinMax1' */ |
| 1175 | if ((rtu_GPID_dT > rtu_GPID_T_filt_d) || rtIsNaN(rtu_GPID_T_filt_d)) { |
| 1176 | maxV = rtu_GPID_dT; |
| 1177 | } else { |
| 1178 | maxV = rtu_GPID_T_filt_d; |
| 1179 | } |
| 1180 | |
| 1181 | localB->MinMax1 = maxV; |
| 1182 | |
| 1183 | /* End of MinMax: '<S121>/MinMax1' */ |
| 1184 | |
| 1185 | /* Saturate: '<S121>/Saturation' */ |
| 1186 | maxV = localB->MinMax1; |
| 1187 | u1 = localP->Saturation_LowerSat; |
| 1188 | u2 = localP->Saturation_UpperSat; |
| 1189 | if (maxV > u2) { |
| 1190 | localB->Saturation = u2; |
| 1191 | } else if (maxV < u1) { |
| 1192 | localB->Saturation = u1; |
| 1193 | } else { |
| 1194 | localB->Saturation = maxV; |
| 1195 | } |
| 1196 | |
| 1197 | /* End of Saturate: '<S121>/Saturation' */ |
| 1198 | |
| 1199 | /* Product: '<S121>/Divide' */ |
| 1200 | localB->Divide = rtu_GPID_dT / localB->Saturation; |
| 1201 | |
| 1202 | /* Product: '<S121>/Product2' */ |
| 1203 | localB->Product2 = rtu_GPID_control_error * localB->Divide; |
| 1204 | |
| 1205 | /* Sum: '<S121>/Subtract1' incorporates: |
| 1206 | * Constant: '<S121>/Constant1' |
| 1207 | */ |
| 1208 | localB->Subtract1 = localP->Constant1_Value - localB->Divide; |
| 1209 | |
| 1210 | /* UnitDelay: '<S121>/Unit_Delay2' */ |
| 1211 | localB->Unit_Delay2 = localDW->Unit_Delay2_DSTATE; |
| 1212 | |
| 1213 | /* Product: '<S121>/Product1' */ |
| 1214 | localB->Product1 = localB->Subtract1 * localB->Unit_Delay2; |
| 1215 | |
| 1216 | /* Sum: '<S121>/Add1' */ |
| 1217 | localB->Add1 = localB->Product2 + localB->Product1; |
| 1218 | |
| 1219 | /* Outputs for Atomic SubSystem: '<S121>/If_Then_Else' */ |
| 1220 | L4_MABX_If_Then_Else(localB->LogicalOperator, rtu_GPID_control_error, |
| 1221 | localB->Add1, &localB->If_Then_Else); |
| 1222 | |
| 1223 | /* End of Outputs for SubSystem: '<S121>/If_Then_Else' */ |
| 1224 | |
| 1225 | /* Product: '<S116>/Divide' */ |
| 1226 | localB->Divide_k = localB->If_Then_Else.Switch / rtu_GPID_dT * rtu_GPID_Kd; |
| 1227 | |
| 1228 | /* UnitDelay: '<S122>/FixPt Unit Delay2' */ |
| 1229 | localB->FixPtUnitDelay2 = localDW->FixPtUnitDelay2_DSTATE; |
| 1230 | |
| 1231 | /* Logic: '<S122>/FixPt Logical Operator' */ |
| 1232 | localB->FixPtLogicalOperator = (uint8_T)(rtu_F_GPID_reset_gov || |
| 1233 | (localB->FixPtUnitDelay2 != 0)); |
| 1234 | |
| 1235 | /* UnitDelay: '<S122>/FixPt Unit Delay1' */ |
| 1236 | localB->Xold = localDW->FixPtUnitDelay1_DSTATE; |
| 1237 | |
| 1238 | /* Switch: '<S122>/Init' */ |
| 1239 | if (localB->FixPtLogicalOperator != 0) { |
| 1240 | localB->Init = localB->Divide_k; |
| 1241 | } else { |
| 1242 | localB->Init = localB->Xold; |
| 1243 | } |
| 1244 | |
| 1245 | /* End of Switch: '<S122>/Init' */ |
| 1246 | |
| 1247 | /* Sum: '<S116>/Subtract' */ |
| 1248 | localB->Subtract = localB->Divide_k - localB->Init; |
| 1249 | |
| 1250 | /* Switch: '<S122>/Reset' */ |
| 1251 | localB->Xnew = localB->Divide_k; |
| 1252 | } else { |
| 1253 | if (localDW->Calculate_D_term_MODE) { |
| 1254 | L4_Calculate_D_term_Disable(localB, localDW, localP); |
| 1255 | } |
| 1256 | } |
| 1257 | |
| 1258 | /* End of Outputs for SubSystem: '<S112>/Calculate_D_term' */ |
| 1259 | } |
| 1260 | |
| 1261 | /* |
| 1262 | * Update for enable system: |
| 1263 | * '<S112>/Calculate_D_term' |
| 1264 | * '<S150>/Calculate_D_term' |
| 1265 | * '<S244>/Calculate_D_term' |
| 1266 | */ |
| 1267 | void L4__Calculate_D_term_Update(B_Calculate_D_term_L4_MABX_T *localB, |
| 1268 | DW_Calculate_D_term_L4_MABX_T *localDW, P_Calculate_D_term_L4_MABX_T *localP) |
| 1269 | { |
| 1270 | /* Update for Enabled SubSystem: '<S112>/Calculate_D_term' incorporates: |
| 1271 | * EnablePort: '<S116>/Enable' |
| 1272 | */ |
| 1273 | if (localDW->Calculate_D_term_MODE) { |
| 1274 | /* Update for UnitDelay: '<S121>/Unit_Delay1' incorporates: |
| 1275 | * Constant: '<S121>/Constant' |
| 1276 | */ |
| 1277 | localDW->Unit_Delay1_DSTATE = localP->Constant_Value; |
| 1278 | |
| 1279 | /* Update for UnitDelay: '<S121>/Unit_Delay2' */ |
| 1280 | localDW->Unit_Delay2_DSTATE = localB->If_Then_Else.Switch; |
| 1281 | |
| 1282 | /* Update for UnitDelay: '<S122>/FixPt Unit Delay2' incorporates: |
| 1283 | * Constant: '<S122>/FixPt Constant' |
| 1284 | */ |
| 1285 | localDW->FixPtUnitDelay2_DSTATE = localP->FixPtConstant_Value; |
| 1286 | |
| 1287 | /* Update for UnitDelay: '<S122>/FixPt Unit Delay1' */ |
| 1288 | localDW->FixPtUnitDelay1_DSTATE = localB->Xnew; |
| 1289 | } |
| 1290 | |
| 1291 | /* End of Update for SubSystem: '<S112>/Calculate_D_term' */ |
| 1292 | } |
| 1293 | |
| 1294 | /* |
| 1295 | * Output and update for atomic system: |
| 1296 | * '<S126>/If_Then_Else3' |
| 1297 | * '<S164>/If_Then_Else3' |
| 1298 | * '<S258>/If_Then_Else3' |
| 1299 | * '<S466>/If_Then_Else' |
| 1300 | * '<S1077>/If_Then_Else' |
| 1301 | */ |
| 1302 | void L4_MABX_If_Then_Else3(boolean_T rtu_If, boolean_T rtu_Then, boolean_T |
| 1303 | rtu_Else, B_If_Then_Else_L4_MABX_c_T *localB) |
| 1304 | { |
| 1305 | /* Switch: '<S134>/Switch' */ |
| 1306 | if (rtu_If) { |
| 1307 | localB->Switch = rtu_Then; |
| 1308 | } else { |
| 1309 | localB->Switch = rtu_Else; |
| 1310 | } |
| 1311 | |
| 1312 | /* End of Switch: '<S134>/Switch' */ |
| 1313 | } |
| 1314 | |
| 1315 | /* |
| 1316 | * System initialize for enable system: |
| 1317 | * '<S112>/Calculate_I_term' |
| 1318 | * '<S150>/Calculate_I_term' |
| 1319 | * '<S244>/Calculate_I_term' |
| 1320 | */ |
| 1321 | void L4_MA_Calculate_I_term_Init(B_Calculate_I_term_L4_MABX_T *localB, |
| 1322 | DW_Calculate_I_term_L4_MABX_T *localDW, P_Calculate_I_term_L4_MABX_T *localP) |
| 1323 | { |
| 1324 | /* InitializeConditions for UnitDelay: '<S128>/FixPt Unit Delay2' */ |
| 1325 | localDW->FixPtUnitDelay2_DSTATE = localP->FixPtUnitDelay2_InitialConditio; |
| 1326 | |
| 1327 | /* InitializeConditions for UnitDelay: '<S128>/FixPt Unit Delay1' */ |
| 1328 | localDW->FixPtUnitDelay1_DSTATE = localP->FixPtUnitDelay1_InitialConditio; |
| 1329 | |
| 1330 | /* InitializeConditions for UnitDelay: '<S117>/Unit_Delay' */ |
| 1331 | localDW->Unit_Delay_DSTATE = localP->Unit_Delay_InitialCondition; |
| 1332 | |
| 1333 | /* SystemInitialize for Enabled SubSystem: '<S117>/Initialize_integral_term' */ |
| 1334 | /* SystemInitialize for Outport: '<S125>/GPID_i_sum_error_init' */ |
| 1335 | localB->Subtract2 = localP->GPID_i_sum_error_init_Y0; |
| 1336 | |
| 1337 | /* End of SystemInitialize for SubSystem: '<S117>/Initialize_integral_term' */ |
| 1338 | |
| 1339 | /* SystemInitialize for Outport: '<S117>/GPID_i_term' */ |
| 1340 | localB->If_Then_Else.Switch = localP->GPID_i_term_Y0; |
| 1341 | |
| 1342 | /* SystemInitialize for Outport: '<S117>/F_GPID_hold_i_term' */ |
| 1343 | localB->LogicalOperator2 = localP->F_GPID_hold_i_term_Y0; |
| 1344 | } |
| 1345 | |
| 1346 | /* |
| 1347 | * System reset for enable system: |
| 1348 | * '<S112>/Calculate_I_term' |
| 1349 | * '<S150>/Calculate_I_term' |
| 1350 | * '<S244>/Calculate_I_term' |
| 1351 | */ |
| 1352 | void L4_M_Calculate_I_term_Reset(DW_Calculate_I_term_L4_MABX_T *localDW, |
| 1353 | P_Calculate_I_term_L4_MABX_T *localP) |
| 1354 | { |
| 1355 | /* InitializeConditions for UnitDelay: '<S128>/FixPt Unit Delay2' */ |
| 1356 | localDW->FixPtUnitDelay2_DSTATE = localP->FixPtUnitDelay2_InitialConditio; |
| 1357 | |
| 1358 | /* InitializeConditions for UnitDelay: '<S128>/FixPt Unit Delay1' */ |
| 1359 | localDW->FixPtUnitDelay1_DSTATE = localP->FixPtUnitDelay1_InitialConditio; |
| 1360 | |
| 1361 | /* InitializeConditions for UnitDelay: '<S117>/Unit_Delay' */ |
| 1362 | localDW->Unit_Delay_DSTATE = localP->Unit_Delay_InitialCondition; |
| 1363 | } |
| 1364 | |
| 1365 | /* |
| 1366 | * Disable for enable system: |
| 1367 | * '<S112>/Calculate_I_term' |
| 1368 | * '<S150>/Calculate_I_term' |
| 1369 | * '<S244>/Calculate_I_term' |
| 1370 | */ |
| 1371 | void L4_Calculate_I_term_Disable(B_Calculate_I_term_L4_MABX_T *localB, |
| 1372 | DW_Calculate_I_term_L4_MABX_T *localDW, P_Calculate_I_term_L4_MABX_T *localP) |
| 1373 | { |
| 1374 | /* Disable for Outport: '<S117>/GPID_i_term' */ |
| 1375 | localB->If_Then_Else.Switch = localP->GPID_i_term_Y0; |
| 1376 | |
| 1377 | /* Disable for Outport: '<S117>/F_GPID_hold_i_term' */ |
| 1378 | localB->LogicalOperator2 = localP->F_GPID_hold_i_term_Y0; |
| 1379 | localDW->Calculate_I_term_MODE = false; |
| 1380 | } |
| 1381 | |
| 1382 | /* |
| 1383 | * Start for enable system: |
| 1384 | * '<S112>/Calculate_I_term' |
| 1385 | * '<S150>/Calculate_I_term' |
| 1386 | * '<S244>/Calculate_I_term' |
| 1387 | */ |
| 1388 | void L4_M_Calculate_I_term_Start(DW_Calculate_I_term_L4_MABX_T *localDW) |
| 1389 | { |
| 1390 | localDW->Calculate_I_term_MODE = false; |
| 1391 | } |
| 1392 | |
| 1393 | /* |
| 1394 | * Outputs for enable system: |
| 1395 | * '<S112>/Calculate_I_term' |
| 1396 | * '<S150>/Calculate_I_term' |
| 1397 | * '<S244>/Calculate_I_term' |
| 1398 | */ |
| 1399 | void L4_MABX_Calculate_I_term(boolean_T rtu_Enable, real_T rtu_GPID_p_term, |
| 1400 | real_T rtu_GPID_Ki, real_T rtu_GPID_actual_system_output, real_T |
| 1401 | rtu_GPID_control_error, boolean_T rtu_F_GPID_reset_gov, real_T rtu_GPID_dT, |
| 1402 | real_T rtu_GPID_feed_forward, boolean_T rtu_F_GPID_aw_cond_integration, real_T |
| 1403 | rtu_GPID_aw_hysteresis, boolean_T rtu_F_GPID_aw_hold_i_term, real_T |
| 1404 | rtu_GPID_output_unlim_prev, B_Calculate_I_term_L4_MABX_T *localB, |
| 1405 | DW_Calculate_I_term_L4_MABX_T *localDW, P_Calculate_I_term_L4_MABX_T *localP) |
| 1406 | { |
| 1407 | /* Outputs for Enabled SubSystem: '<S112>/Calculate_I_term' incorporates: |
| 1408 | * EnablePort: '<S117>/Enable' |
| 1409 | */ |
| 1410 | if (rtu_Enable) { |
| 1411 | if (!localDW->Calculate_I_term_MODE) { |
| 1412 | L4_M_Calculate_I_term_Reset(localDW, localP); |
| 1413 | localDW->Calculate_I_term_MODE = true; |
| 1414 | } |
| 1415 | |
| 1416 | /* Outputs for Enabled SubSystem: '<S117>/Initialize_integral_term' incorporates: |
| 1417 | * EnablePort: '<S125>/Enable' |
| 1418 | */ |
| 1419 | if (rtu_F_GPID_reset_gov) { |
| 1420 | /* Product: '<S125>/Product' */ |
| 1421 | localB->Product_j = rtu_GPID_Ki * rtu_GPID_dT * rtu_GPID_control_error; |
| 1422 | |
| 1423 | /* Sum: '<S125>/Subtract' */ |
| 1424 | localB->Subtract_g = rtu_GPID_actual_system_output - rtu_GPID_feed_forward; |
| 1425 | |
| 1426 | /* Sum: '<S125>/Subtract1' */ |
| 1427 | localB->Subtract1_k = localB->Subtract_g - rtu_GPID_p_term; |
| 1428 | |
| 1429 | /* Sum: '<S125>/Subtract2' */ |
| 1430 | localB->Subtract2 = localB->Subtract1_k - localB->Product_j; |
| 1431 | } |
| 1432 | |
| 1433 | /* End of Outputs for SubSystem: '<S117>/Initialize_integral_term' */ |
| 1434 | |
| 1435 | /* UnitDelay: '<S128>/FixPt Unit Delay2' */ |
| 1436 | localB->FixPtUnitDelay2 = localDW->FixPtUnitDelay2_DSTATE; |
| 1437 | |
| 1438 | /* Logic: '<S128>/FixPt Logical Operator' */ |
| 1439 | localB->FixPtLogicalOperator = (uint8_T)(rtu_F_GPID_reset_gov || |
| 1440 | (localB->FixPtUnitDelay2 != 0)); |
| 1441 | |
| 1442 | /* UnitDelay: '<S128>/FixPt Unit Delay1' */ |
| 1443 | localB->Xold = localDW->FixPtUnitDelay1_DSTATE; |
| 1444 | |
| 1445 | /* Switch: '<S128>/Init' */ |
| 1446 | if (localB->FixPtLogicalOperator != 0) { |
| 1447 | localB->Init = localB->Subtract2; |
| 1448 | } else { |
| 1449 | localB->Init = localB->Xold; |
| 1450 | } |
| 1451 | |
| 1452 | /* End of Switch: '<S128>/Init' */ |
| 1453 | |
| 1454 | /* Product: '<S124>/Product1' */ |
| 1455 | localB->Product1 = rtu_GPID_Ki * rtu_GPID_control_error * rtu_GPID_dT; |
| 1456 | |
| 1457 | /* Sum: '<S124>/Add' */ |
| 1458 | localB->Add = localB->Init + localB->Product1; |
| 1459 | |
| 1460 | /* UnitDelay: '<S117>/Unit_Delay' */ |
| 1461 | localB->Unit_Delay = localDW->Unit_Delay_DSTATE; |
| 1462 | |
| 1463 | /* Outputs for Atomic SubSystem: '<S126>/If_Then_Else' */ |
| 1464 | |
| 1465 | /* Constant: '<S126>/Constant' */ |
| 1466 | L4_MABX_If_Then_Else(rtu_F_GPID_reset_gov, localP->Constant_Value, |
| 1467 | localB->Unit_Delay, &localB->If_Then_Else_c); |
| 1468 | |
| 1469 | /* End of Outputs for SubSystem: '<S126>/If_Then_Else' */ |
| 1470 | |
| 1471 | /* Outputs for Atomic SubSystem: '<S126>/If_Then_Else2' */ |
| 1472 | L4_MABX_If_Then_Else(rtu_F_GPID_reset_gov, rtu_GPID_actual_system_output, |
| 1473 | rtu_GPID_output_unlim_prev, &localB->If_Then_Else2); |
| 1474 | |
| 1475 | /* End of Outputs for SubSystem: '<S126>/If_Then_Else2' */ |
| 1476 | |
| 1477 | /* Outputs for Atomic SubSystem: '<S126>/If_Then_Else1' */ |
| 1478 | L4_MABX_If_Then_Else(rtu_F_GPID_aw_cond_integration, |
| 1479 | localB->If_Then_Else_c.Switch, |
| 1480 | localB->If_Then_Else2.Switch, &localB->If_Then_Else1); |
| 1481 | |
| 1482 | /* End of Outputs for SubSystem: '<S126>/If_Then_Else1' */ |
| 1483 | |
| 1484 | /* Product: '<S126>/Product' */ |
| 1485 | localB->Product = rtu_GPID_Ki * rtu_GPID_control_error * |
| 1486 | localB->If_Then_Else1.Switch; |
| 1487 | |
| 1488 | /* RelationalOperator: '<S129>/Compare' incorporates: |
| 1489 | * Constant: '<S129>/Constant' |
| 1490 | */ |
| 1491 | localB->Compare = (localB->Product > localP->Constant_Value_p); |
| 1492 | |
| 1493 | /* RelationalOperator: '<S130>/Compare' incorporates: |
| 1494 | * Constant: '<S130>/Constant' |
| 1495 | */ |
| 1496 | localB->Compare_n = (localB->Unit_Delay >= localP->Constant_Value_b); |
| 1497 | |
| 1498 | /* Sum: '<S126>/Subtract' */ |
| 1499 | localB->Subtract = localB->If_Then_Else2.Switch - |
| 1500 | rtu_GPID_actual_system_output; |
| 1501 | |
| 1502 | /* RelationalOperator: '<S126>/Relational Operator1' */ |
| 1503 | localB->RelationalOperator1 = (localB->Subtract > rtu_GPID_aw_hysteresis); |
| 1504 | |
| 1505 | /* Sum: '<S126>/Subtract1' */ |
| 1506 | localB->Subtract1 = rtu_GPID_actual_system_output - |
| 1507 | localB->If_Then_Else2.Switch; |
| 1508 | |
| 1509 | /* RelationalOperator: '<S126>/Relational Operator2' */ |
| 1510 | localB->RelationalOperator2 = (localB->Subtract1 > rtu_GPID_aw_hysteresis); |
| 1511 | |
| 1512 | /* Outputs for Atomic SubSystem: '<S126>/If_Then_Else3' */ |
| 1513 | L4_MABX_If_Then_Else3(localB->Compare_n, localB->RelationalOperator1, |
| 1514 | localB->RelationalOperator2, &localB->If_Then_Else3); |
| 1515 | |
| 1516 | /* End of Outputs for SubSystem: '<S126>/If_Then_Else3' */ |
| 1517 | |
| 1518 | /* Logic: '<S126>/Logical Operator1' */ |
| 1519 | localB->LogicalOperator1 = (localB->Compare && localB->If_Then_Else3.Switch); |
| 1520 | |
| 1521 | /* Logic: '<S126>/Logical Operator2' */ |
| 1522 | localB->LogicalOperator2 = (localB->LogicalOperator1 || |
| 1523 | rtu_F_GPID_aw_hold_i_term); |
| 1524 | |
| 1525 | /* Outputs for Atomic SubSystem: '<S124>/If_Then_Else' */ |
| 1526 | L4_MABX_If_Then_Else(localB->LogicalOperator2, localB->Init, localB->Add, |
| 1527 | &localB->If_Then_Else); |
| 1528 | |
| 1529 | /* End of Outputs for SubSystem: '<S124>/If_Then_Else' */ |
| 1530 | |
| 1531 | /* Switch: '<S128>/Reset' */ |
| 1532 | if (rtu_F_GPID_reset_gov) { |
| 1533 | localB->Xnew = localB->Subtract2; |
| 1534 | } else { |
| 1535 | localB->Xnew = localB->If_Then_Else.Switch; |
| 1536 | } |
| 1537 | |
| 1538 | /* End of Switch: '<S128>/Reset' */ |
| 1539 | } else { |
| 1540 | if (localDW->Calculate_I_term_MODE) { |
| 1541 | L4_Calculate_I_term_Disable(localB, localDW, localP); |
| 1542 | } |
| 1543 | } |
| 1544 | |
| 1545 | /* End of Outputs for SubSystem: '<S112>/Calculate_I_term' */ |
| 1546 | } |
| 1547 | |
| 1548 | /* |
| 1549 | * Update for enable system: |
| 1550 | * '<S112>/Calculate_I_term' |
| 1551 | * '<S150>/Calculate_I_term' |
| 1552 | * '<S244>/Calculate_I_term' |
| 1553 | */ |
| 1554 | void L4__Calculate_I_term_Update(B_Calculate_I_term_L4_MABX_T *localB, |
| 1555 | DW_Calculate_I_term_L4_MABX_T *localDW, P_Calculate_I_term_L4_MABX_T *localP) |
| 1556 | { |
| 1557 | /* Update for Enabled SubSystem: '<S112>/Calculate_I_term' incorporates: |
| 1558 | * EnablePort: '<S117>/Enable' |
| 1559 | */ |
| 1560 | if (localDW->Calculate_I_term_MODE) { |
| 1561 | /* Update for UnitDelay: '<S128>/FixPt Unit Delay2' incorporates: |
| 1562 | * Constant: '<S128>/FixPt Constant' |
| 1563 | */ |
| 1564 | localDW->FixPtUnitDelay2_DSTATE = localP->FixPtConstant_Value; |
| 1565 | |
| 1566 | /* Update for UnitDelay: '<S128>/FixPt Unit Delay1' */ |
| 1567 | localDW->FixPtUnitDelay1_DSTATE = localB->Xnew; |
| 1568 | |
| 1569 | /* Update for UnitDelay: '<S117>/Unit_Delay' */ |
| 1570 | localDW->Unit_Delay_DSTATE = localB->If_Then_Else.Switch; |
| 1571 | } |
| 1572 | |
| 1573 | /* End of Update for SubSystem: '<S112>/Calculate_I_term' */ |
| 1574 | } |
| 1575 | |
| 1576 | /* Output and update for atomic system: '<S104>/If_Then_Else' */ |
| 1577 | void L4_MABX_If_Then_Else_l(boolean_T rtu_If, boolean_T rtu_Then, boolean_T |
| 1578 | rtu_Else, B_If_Then_Else_L4_MABX_m_T *localB) |
| 1579 | { |
| 1580 | /* Switch: '<S182>/Switch' */ |
| 1581 | if (rtu_If) { |
| 1582 | localB->Switch = rtu_Then; |
| 1583 | } else { |
| 1584 | localB->Switch = rtu_Else; |
| 1585 | } |
| 1586 | |
| 1587 | /* End of Switch: '<S182>/Switch' */ |
| 1588 | } |
| 1589 | |
| 1590 | /* |
| 1591 | * Output and update for atomic system: |
| 1592 | * '<S183>/If_Then_Else' |
| 1593 | * '<S183>/If_Then_Else1' |
| 1594 | * '<S184>/If_Then_Else' |
| 1595 | * '<S184>/If_Then_Else1' |
| 1596 | * '<S280>/If_Then_Else' |
| 1597 | * '<S281>/If_Then_Else' |
| 1598 | * '<S281>/If_Then_Else1' |
| 1599 | * '<S360>/If_Then_Else' |
| 1600 | * '<S357>/If_Then_Else' |
| 1601 | * '<S366>/If_Then_Else' |
| 1602 | * ... |
| 1603 | */ |
| 1604 | void L4_MABX_If_Then_Else_g(boolean_T rtu_If, real_T rtu_Then, real_T rtu_Else, |
| 1605 | B_If_Then_Else_L4_MABX_k_T *localB) |
| 1606 | { |
| 1607 | /* Switch: '<S185>/Switch' */ |
| 1608 | if (rtu_If) { |
| 1609 | localB->Switch = rtu_Then; |
| 1610 | } else { |
| 1611 | localB->Switch = rtu_Else; |
| 1612 | } |
| 1613 | |
| 1614 | /* End of Switch: '<S185>/Switch' */ |
| 1615 | } |
| 1616 | |
| 1617 | /* Output and update for atomic system: '<S310>/If_Then_Else' */ |
| 1618 | void L4_MABX_If_Then_Else_c(real_T rtu_If, real_T rtu_Then, real_T rtu_Else, |
| 1619 | B_If_Then_Else_L4_MABX_mf_T *localB) |
| 1620 | { |
| 1621 | /* Switch: '<S320>/Switch' */ |
| 1622 | if (rtu_If != 0.0) { |
| 1623 | localB->Switch = rtu_Then; |
| 1624 | } else { |
| 1625 | localB->Switch = rtu_Else; |
| 1626 | } |
| 1627 | |
| 1628 | /* End of Switch: '<S320>/Switch' */ |
| 1629 | } |
| 1630 | |
| 1631 | /* Output and update for atomic system: '<S350>/If_Then_Else' */ |
| 1632 | void L4_MABX_If_Then_Else_m(boolean_T rtu_If, real_T rtu_Then, real_T rtu_Then_l, |
| 1633 | real_T rtu_Then_f, real_T rtu_Else, real_T rtu_Else_i, real_T rtu_Else_k, |
| 1634 | B_If_Then_Else_L4_MABX_h_T *localB) |
| 1635 | { |
| 1636 | /* Switch: '<S352>/Switch' */ |
| 1637 | if (rtu_If) { |
| 1638 | localB->Vehicle_speed_target = rtu_Then; |
| 1639 | localB->Vehicle_speed = rtu_Then_l; |
| 1640 | localB->Distance_m = rtu_Then_f; |
| 1641 | } else { |
| 1642 | localB->Vehicle_speed_target = rtu_Else; |
| 1643 | localB->Vehicle_speed = rtu_Else_i; |
| 1644 | localB->Distance_m = rtu_Else_k; |
| 1645 | } |
| 1646 | |
| 1647 | /* End of Switch: '<S352>/Switch' */ |
| 1648 | } |
| 1649 | |
| 1650 | /* System initialize for function-call system: '<S399>/Background_Task' */ |
| 1651 | void L4_MAB_Background_Task_Init(void) |
| 1652 | { |
| 1653 | /* InitializeConditions for S-Function (dsa_tcpip_bkg_sfcn): '<S409>/dsa_tcpip_bkg_sfcn' */ |
| 1654 | /* Level2 S-Function Block: '<S409>/dsa_tcpip_bkg_sfcn' (dsa_tcpip_bkg_sfcn) */ |
| 1655 | { |
| 1656 | SimStruct *rts = L4_MABX_M->childSfunctions[0]; |
| 1657 | sfcnInitializeConditions(rts); |
| 1658 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1659 | return; |
| 1660 | } |
| 1661 | } |
| 1662 | |
| 1663 | /* System reset for function-call system: '<S399>/Background_Task' */ |
| 1664 | void L4_MA_Background_Task_Reset(void) |
| 1665 | { |
| 1666 | /* InitializeConditions for S-Function (dsa_tcpip_bkg_sfcn): '<S409>/dsa_tcpip_bkg_sfcn' */ |
| 1667 | /* Level2 S-Function Block: '<S409>/dsa_tcpip_bkg_sfcn' (dsa_tcpip_bkg_sfcn) */ |
| 1668 | { |
| 1669 | SimStruct *rts = L4_MABX_M->childSfunctions[0]; |
| 1670 | sfcnInitializeConditions(rts); |
| 1671 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1672 | return; |
| 1673 | } |
| 1674 | } |
| 1675 | |
| 1676 | /* Start for function-call system: '<S399>/Background_Task' */ |
| 1677 | void L4_MA_Background_Task_Start(void) |
| 1678 | { |
| 1679 | /* Start for S-Function (dsa_tcpip_bkg_sfcn): '<S409>/dsa_tcpip_bkg_sfcn' */ |
| 1680 | /* Level2 S-Function Block: '<S409>/dsa_tcpip_bkg_sfcn' (dsa_tcpip_bkg_sfcn) */ |
| 1681 | { |
| 1682 | SimStruct *rts = L4_MABX_M->childSfunctions[0]; |
| 1683 | sfcnStart(rts); |
| 1684 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1685 | return; |
| 1686 | } |
| 1687 | } |
| 1688 | |
| 1689 | /* Output and update for function-call system: '<S399>/Background_Task' */ |
| 1690 | void L4_MABX_Background_Task(void) |
| 1691 | { |
| 1692 | /* S-Function (dsa_tcpip_bkg_sfcn): '<S409>/dsa_tcpip_bkg_sfcn' */ |
| 1693 | |
| 1694 | /* Level2 S-Function Block: '<S409>/dsa_tcpip_bkg_sfcn' (dsa_tcpip_bkg_sfcn) */ |
| 1695 | { |
| 1696 | SimStruct *rts = L4_MABX_M->childSfunctions[0]; |
| 1697 | sfcnOutputs(rts,9); |
| 1698 | } |
| 1699 | } |
| 1700 | |
| 1701 | /* Termination for function-call system: '<S399>/Background_Task' */ |
| 1702 | void L4_MAB_Background_Task_Term(void) |
| 1703 | { |
| 1704 | /* Terminate for S-Function (dsa_tcpip_bkg_sfcn): '<S409>/dsa_tcpip_bkg_sfcn' */ |
| 1705 | /* Level2 S-Function Block: '<S409>/dsa_tcpip_bkg_sfcn' (dsa_tcpip_bkg_sfcn) */ |
| 1706 | { |
| 1707 | SimStruct *rts = L4_MABX_M->childSfunctions[0]; |
| 1708 | sfcnTerminate(rts); |
| 1709 | } |
| 1710 | } |
| 1711 | |
| 1712 | /* System initialize for function-call system: '<S399>/IRQ_Level_2_SW_INT' */ |
| 1713 | void L4__IRQ_Level_2_SW_INT_Init(void) |
| 1714 | { |
| 1715 | /* InitializeConditions for S-Function (dsa_tcpip_irq_l2_sfcn): '<S410>/dsa_tcpip_irq_l2_sfcn' */ |
| 1716 | /* Level2 S-Function Block: '<S410>/dsa_tcpip_irq_l2_sfcn' (dsa_tcpip_irq_l2_sfcn) */ |
| 1717 | { |
| 1718 | SimStruct *rts = L4_MABX_M->childSfunctions[1]; |
| 1719 | sfcnInitializeConditions(rts); |
| 1720 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1721 | return; |
| 1722 | } |
| 1723 | } |
| 1724 | |
| 1725 | /* System reset for function-call system: '<S399>/IRQ_Level_2_SW_INT' */ |
| 1726 | void L4_IRQ_Level_2_SW_INT_Reset(void) |
| 1727 | { |
| 1728 | /* InitializeConditions for S-Function (dsa_tcpip_irq_l2_sfcn): '<S410>/dsa_tcpip_irq_l2_sfcn' */ |
| 1729 | /* Level2 S-Function Block: '<S410>/dsa_tcpip_irq_l2_sfcn' (dsa_tcpip_irq_l2_sfcn) */ |
| 1730 | { |
| 1731 | SimStruct *rts = L4_MABX_M->childSfunctions[1]; |
| 1732 | sfcnInitializeConditions(rts); |
| 1733 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1734 | return; |
| 1735 | } |
| 1736 | } |
| 1737 | |
| 1738 | /* Start for function-call system: '<S399>/IRQ_Level_2_SW_INT' */ |
| 1739 | void L4_IRQ_Level_2_SW_INT_Start(void) |
| 1740 | { |
| 1741 | /* Start for S-Function (dsa_tcpip_irq_l2_sfcn): '<S410>/dsa_tcpip_irq_l2_sfcn' */ |
| 1742 | /* Level2 S-Function Block: '<S410>/dsa_tcpip_irq_l2_sfcn' (dsa_tcpip_irq_l2_sfcn) */ |
| 1743 | { |
| 1744 | SimStruct *rts = L4_MABX_M->childSfunctions[1]; |
| 1745 | sfcnStart(rts); |
| 1746 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1747 | return; |
| 1748 | } |
| 1749 | } |
| 1750 | |
| 1751 | /* Output and update for function-call system: '<S399>/IRQ_Level_2_SW_INT' */ |
| 1752 | void L4_MABX_IRQ_Level_2_SW_INT(void) |
| 1753 | { |
| 1754 | /* S-Function (dsa_tcpip_irq_l2_sfcn): '<S410>/dsa_tcpip_irq_l2_sfcn' */ |
| 1755 | |
| 1756 | /* Level2 S-Function Block: '<S410>/dsa_tcpip_irq_l2_sfcn' (dsa_tcpip_irq_l2_sfcn) */ |
| 1757 | { |
| 1758 | SimStruct *rts = L4_MABX_M->childSfunctions[1]; |
| 1759 | sfcnOutputs(rts,10); |
| 1760 | } |
| 1761 | } |
| 1762 | |
| 1763 | /* Termination for function-call system: '<S399>/IRQ_Level_2_SW_INT' */ |
| 1764 | void L4__IRQ_Level_2_SW_INT_Term(void) |
| 1765 | { |
| 1766 | /* Terminate for S-Function (dsa_tcpip_irq_l2_sfcn): '<S410>/dsa_tcpip_irq_l2_sfcn' */ |
| 1767 | /* Level2 S-Function Block: '<S410>/dsa_tcpip_irq_l2_sfcn' (dsa_tcpip_irq_l2_sfcn) */ |
| 1768 | { |
| 1769 | SimStruct *rts = L4_MABX_M->childSfunctions[1]; |
| 1770 | sfcnTerminate(rts); |
| 1771 | } |
| 1772 | } |
| 1773 | |
| 1774 | /* System initialize for function-call system: '<S411>/Tcp Input Processing' */ |
| 1775 | void L4__TcpInputProcessing_Init(void) |
| 1776 | { |
| 1777 | /* SystemInitialize for S-Function (rti_commonblock): '<S413>/S-Function1' incorporates: |
| 1778 | * SubSystem: '<S399>/IRQ_Level_2_SW_INT' |
| 1779 | */ |
| 1780 | L4__IRQ_Level_2_SW_INT_Init(); |
| 1781 | |
| 1782 | /* End of SystemInitialize for S-Function (rti_commonblock): '<S413>/S-Function1' */ |
| 1783 | } |
| 1784 | |
| 1785 | /* System reset for function-call system: '<S411>/Tcp Input Processing' */ |
| 1786 | void L4_TcpInputProcessing_Reset(void) |
| 1787 | { |
| 1788 | /* SystemReset for S-Function (rti_commonblock): '<S413>/S-Function1' incorporates: |
| 1789 | * SubSystem: '<S399>/IRQ_Level_2_SW_INT' |
| 1790 | */ |
| 1791 | L4_IRQ_Level_2_SW_INT_Reset(); |
| 1792 | |
| 1793 | /* End of SystemReset for S-Function (rti_commonblock): '<S413>/S-Function1' */ |
| 1794 | } |
| 1795 | |
| 1796 | /* Start for function-call system: '<S411>/Tcp Input Processing' */ |
| 1797 | void L4_TcpInputProcessing_Start(void) |
| 1798 | { |
| 1799 | /* Start for S-Function (rti_commonblock): '<S413>/S-Function1' incorporates: |
| 1800 | * SubSystem: '<S399>/IRQ_Level_2_SW_INT' |
| 1801 | */ |
| 1802 | L4_IRQ_Level_2_SW_INT_Start(); |
| 1803 | |
| 1804 | /* End of Start for S-Function (rti_commonblock): '<S413>/S-Function1' */ |
| 1805 | } |
| 1806 | |
| 1807 | /* Output and update for function-call system: '<S411>/Tcp Input Processing' */ |
| 1808 | void L4_MABX_TcpInputProcessing(void) |
| 1809 | { |
| 1810 | /* S-Function (rti_commonblock): '<S413>/S-Function1' */ |
| 1811 | |
| 1812 | /* This comment workarounds a code generation problem */ |
| 1813 | |
| 1814 | /* dSPACE Software Interrupt Block: <S411>/Tcp Input Processing */ |
| 1815 | rtk_schedule_task(S_SOFTTASK,0); |
| 1816 | |
| 1817 | /* End of Outputs for S-Function (rti_commonblock): '<S413>/S-Function1' */ |
| 1818 | } |
| 1819 | |
| 1820 | /* |
| 1821 | * Forced non-inlined (FNI) function call stub |
| 1822 | * for '<S411>/Tcp Input Processing' |
| 1823 | */ |
| 1824 | boolean_T L4_MABX_TcpInputProcessingFNI(RT_MODEL_L4_MABX_T *const L4_MABX_M, |
| 1825 | int_T controlPortIdx, int_T tid) |
| 1826 | { |
| 1827 | L4_MABX_TcpInputProcessing(); |
| 1828 | UNUSED_PARAMETER(L4_MABX_M); |
| 1829 | UNUSED_PARAMETER(controlPortIdx); |
| 1830 | UNUSED_PARAMETER(tid); |
| 1831 | return (1); |
| 1832 | } |
| 1833 | |
| 1834 | /* |
| 1835 | * Forced non-inlined (FNI) function call stub |
| 1836 | * for '<S411>/Tcp Input Processing' |
| 1837 | */ |
| 1838 | boolean_T L4_TcpInputProcessing_ResetFNI(RT_MODEL_L4_MABX_T *const L4_MABX_M, |
| 1839 | int_T controlPortIdx, int_T tid) |
| 1840 | { |
| 1841 | UNUSED_PARAMETER(L4_MABX_M); |
| 1842 | UNUSED_PARAMETER(controlPortIdx); |
| 1843 | UNUSED_PARAMETER(tid); |
| 1844 | return (1); |
| 1845 | } |
| 1846 | |
| 1847 | /* Termination for function-call system: '<S411>/Tcp Input Processing' */ |
| 1848 | void L4__TcpInputProcessing_Term(void) |
| 1849 | { |
| 1850 | /* Terminate for S-Function (rti_commonblock): '<S413>/S-Function1' incorporates: |
| 1851 | * SubSystem: '<S399>/IRQ_Level_2_SW_INT' |
| 1852 | */ |
| 1853 | L4__IRQ_Level_2_SW_INT_Term(); |
| 1854 | |
| 1855 | /* End of Terminate for S-Function (rti_commonblock): '<S413>/S-Function1' */ |
| 1856 | } |
| 1857 | |
| 1858 | /* System initialize for function-call system: '<S399>/Interrupt_Task' */ |
| 1859 | void L4_MABX_Interrupt_Task_Init(void) |
| 1860 | { |
| 1861 | /* InitializeConditions for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */ |
| 1862 | |
| 1863 | /* Level2 S-Function Block: '<S411>/dsa_tcpip_irq_l1_sfcn' (dsa_tcpip_irq_l1_sfcn) */ |
| 1864 | { |
| 1865 | SimStruct *rts = L4_MABX_M->childSfunctions[2]; |
| 1866 | sfcnInitializeConditions(rts); |
| 1867 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1868 | return; |
| 1869 | } |
| 1870 | |
| 1871 | /* End of InitializeConditions for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */ |
| 1872 | |
| 1873 | /* SystemInitialize for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' incorporates: |
| 1874 | * SubSystem: '<S411>/Tcp Input Processing' |
| 1875 | */ |
| 1876 | L4__TcpInputProcessing_Init(); |
| 1877 | |
| 1878 | /* End of SystemInitialize for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */ |
| 1879 | } |
| 1880 | |
| 1881 | /* System reset for function-call system: '<S399>/Interrupt_Task' */ |
| 1882 | void L4_MAB_Interrupt_Task_Reset(void) |
| 1883 | { |
| 1884 | /* InitializeConditions for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */ |
| 1885 | |
| 1886 | /* Level2 S-Function Block: '<S411>/dsa_tcpip_irq_l1_sfcn' (dsa_tcpip_irq_l1_sfcn) */ |
| 1887 | { |
| 1888 | SimStruct *rts = L4_MABX_M->childSfunctions[2]; |
| 1889 | sfcnInitializeConditions(rts); |
| 1890 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1891 | return; |
| 1892 | } |
| 1893 | |
| 1894 | /* End of InitializeConditions for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */ |
| 1895 | |
| 1896 | /* SystemReset for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' incorporates: |
| 1897 | * SubSystem: '<S411>/Tcp Input Processing' |
| 1898 | */ |
| 1899 | L4_TcpInputProcessing_Reset(); |
| 1900 | |
| 1901 | /* End of SystemReset for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */ |
| 1902 | } |
| 1903 | |
| 1904 | /* Start for function-call system: '<S399>/Interrupt_Task' */ |
| 1905 | void L4_MAB_Interrupt_Task_Start(void) |
| 1906 | { |
| 1907 | /* Start for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' incorporates: |
| 1908 | * SubSystem: '<S411>/Tcp Input Processing' |
| 1909 | */ |
| 1910 | L4_TcpInputProcessing_Start(); |
| 1911 | |
| 1912 | /* Level2 S-Function Block: '<S411>/dsa_tcpip_irq_l1_sfcn' (dsa_tcpip_irq_l1_sfcn) */ |
| 1913 | { |
| 1914 | SimStruct *rts = L4_MABX_M->childSfunctions[2]; |
| 1915 | sfcnStart(rts); |
| 1916 | if (ssGetErrorStatus(rts) != (NULL)) |
| 1917 | return; |
| 1918 | } |
| 1919 | |
| 1920 | /* End of Start for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */ |
| 1921 | } |
| 1922 | |
| 1923 | /* Output and update for function-call system: '<S399>/Interrupt_Task' */ |
| 1924 | void L4_MABX_Interrupt_Task(void) |
| 1925 | { |
| 1926 | /* S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */ |
| 1927 | |
| 1928 | /* Level2 S-Function Block: '<S411>/dsa_tcpip_irq_l1_sfcn' (dsa_tcpip_irq_l1_sfcn) */ |
| 1929 | { |
| 1930 | SimStruct *rts = L4_MABX_M->childSfunctions[2]; |
| 1931 | sfcnOutputs(rts,11); |
| 1932 | } |
| 1933 | |
| 1934 | /* End of Outputs for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */ |
| 1935 | } |
| 1936 | |
| 1937 | /* Termination for function-call system: '<S399>/Interrupt_Task' */ |
| 1938 | void L4_MABX_Interrupt_Task_Term(void) |
| 1939 | { |
| 1940 | /* Terminate for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */ |
| 1941 | |
| 1942 | /* Level2 S-Function Block: '<S411>/dsa_tcpip_irq_l1_sfcn' (dsa_tcpip_irq_l1_sfcn) */ |
| 1943 | { |
| 1944 | SimStruct *rts = L4_MABX_M->childSfunctions[2]; |
| 1945 | sfcnTerminate(rts); |
| 1946 | } |
| 1947 | |
| 1948 | /* End of Terminate for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */ |
| 1949 | |
| 1950 | /* Terminate for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' incorporates: |
| 1951 | * SubSystem: '<S411>/Tcp Input Processing' |
| 1952 | */ |
| 1953 | L4__TcpInputProcessing_Term(); |
| 1954 | |
| 1955 | /* End of Terminate for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */ |
| 1956 | } |
| 1957 | |
| 1958 | /* Output and update for atomic system: '<S744>/If_Then_Else' */ |
| 1959 | void L4_MABX_If_Then_Else_j(boolean_T rtu_If, real_T rtu_Then, real_T rtu_Else) |
| 1960 | { |
| 1961 | /* Switch: '<S765>/Switch' */ |
| 1962 | if (rtu_If) { |
| 1963 | Pedal_pwm_position = rtu_Then; |
| 1964 | } else { |
| 1965 | Pedal_pwm_position = rtu_Else; |
| 1966 | } |
| 1967 | |
| 1968 | /* End of Switch: '<S765>/Switch' */ |
| 1969 | } |
| 1970 | |
| 1971 | /* System initialize for function-call system: '<S417>/IncrementTimer' */ |
| 1972 | void L4_MABX_IncrementTimer_Init(void) |
| 1973 | { |
| 1974 | /* InitializeConditions for UnitDelay: '<S847>/Unit_Delay' */ |
| 1975 | L4_MABX_DW.Unit_Delay_DSTATE_l = L4_MABX_P.Unit_Delay_InitialCondition_kt; |
| 1976 | |
| 1977 | /* SystemInitialize for Outport: '<S847>/Out1' */ |
| 1978 | L4_MABX_B.Add = L4_MABX_P.Out1_Y0_c; |
| 1979 | } |
| 1980 | |
| 1981 | /* System reset for function-call system: '<S417>/IncrementTimer' */ |
| 1982 | void L4_MAB_IncrementTimer_Reset(void) |
| 1983 | { |
| 1984 | /* InitializeConditions for UnitDelay: '<S847>/Unit_Delay' */ |
| 1985 | L4_MABX_DW.Unit_Delay_DSTATE_l = L4_MABX_P.Unit_Delay_InitialCondition_kt; |
| 1986 | } |
| 1987 | |
| 1988 | /* Output and update for function-call system: '<S417>/IncrementTimer' */ |
| 1989 | void L4_MABX_IncrementTimer(void) |
| 1990 | { |
| 1991 | /* UnitDelay: '<S847>/Unit_Delay' */ |
| 1992 | L4_MABX_B.Unit_Delay_g = L4_MABX_DW.Unit_Delay_DSTATE_l; |
| 1993 | |
| 1994 | /* Sum: '<S847>/Add' incorporates: |
| 1995 | * Constant: '<S847>/Constant1' |
| 1996 | */ |
| 1997 | L4_MABX_B.Add = L4_MABX_P.Constant1_Value_mq + L4_MABX_B.Unit_Delay_g; |
| 1998 | |
| 1999 | /* Update for UnitDelay: '<S847>/Unit_Delay' */ |
| 2000 | L4_MABX_DW.Unit_Delay_DSTATE_l = L4_MABX_B.Add; |
| 2001 | } |
| 2002 | |
| 2003 | /* |
| 2004 | * Output and update for enable system: |
| 2005 | * '<S977>/ALL_CTRL_DISABLED' |
| 2006 | * '<S977>/DEFAULT_TRQ_CTRL_MODE' |
| 2007 | * '<S977>/EXT_TRQ_CTRL_MODE_A' |
| 2008 | * '<S977>/EXT_TRQ_CTRL_MODE_B' |
| 2009 | * '<S977>/EXT_TRQ_CTRL_MODE_C' |
| 2010 | */ |
| 2011 | void L4_MABX_ALL_CTRL_DISABLED(boolean_T rtu_Enable, int32_T *rty_Out1, |
| 2012 | P_ALL_CTRL_DISABLED_L4_MABX_T *localP) |
| 2013 | { |
| 2014 | /* Outputs for Enabled SubSystem: '<S977>/ALL_CTRL_DISABLED' incorporates: |
| 2015 | * EnablePort: '<S992>/Enable' |
| 2016 | */ |
| 2017 | if (rtu_Enable) { |
| 2018 | /* SignalConversion: '<S992>/OutportBufferForOut1' incorporates: |
| 2019 | * Constant: '<S992>/Constant' |
| 2020 | */ |
| 2021 | *rty_Out1 = localP->Constant_Value; |
| 2022 | } |
| 2023 | |
| 2024 | /* End of Outputs for SubSystem: '<S977>/ALL_CTRL_DISABLED' */ |
| 2025 | } |
| 2026 | |
| 2027 | /* Output and update for atomic system: '<S1015>/If_Then_Else' */ |
| 2028 | void L4_MABX_If_Then_Else_o(boolean_T rtu_If, real_T rtu_Then, |
| 2029 | ENUM_XBR_EBI_MODE_T rtu_Then_b, ENUM_XBR_PRIORITY_T rtu_Then_bo, |
| 2030 | ENUM_XBR_CONTROL_MODE_T rtu_Then_a, ENUM_XBR_PASS_THROUGH_ACTIVE_T rtu_Then_g, |
| 2031 | real_T rtu_Then_d, real_T rtu_Then_h, real_T rtu_Else, ENUM_XBR_EBI_MODE_T |
| 2032 | rtu_Else_e, ENUM_XBR_PRIORITY_T rtu_Else_d, ENUM_XBR_CONTROL_MODE_T rtu_Else_o, |
| 2033 | ENUM_XBR_PASS_THROUGH_ACTIVE_T rtu_Else_h, real_T rtu_Else_f, real_T |
| 2034 | rtu_Else_k, B_If_Then_Else_L4_MABX_f_T *localB) |
| 2035 | { |
| 2036 | /* Switch: '<S1039>/Switch' */ |
| 2037 | if (rtu_If) { |
| 2038 | localB->XBRExternalAccelDemand = rtu_Then; |
| 2039 | localB->XBREnduranceBrakeIntegrationMod = rtu_Then_b; |
| 2040 | localB->XBRPriority = rtu_Then_bo; |
| 2041 | localB->XBRControlMode = rtu_Then_a; |
| 2042 | localB->XBRPassThroughActive = rtu_Then_g; |
| 2043 | localB->XBRUrgency = rtu_Then_d; |
| 2044 | localB->XBRPassThroughEnabled = rtu_Then_h; |
| 2045 | } else { |
| 2046 | localB->XBRExternalAccelDemand = rtu_Else; |
| 2047 | localB->XBREnduranceBrakeIntegrationMod = rtu_Else_e; |
| 2048 | localB->XBRPriority = rtu_Else_d; |
| 2049 | localB->XBRControlMode = rtu_Else_o; |
| 2050 | localB->XBRPassThroughActive = rtu_Else_h; |
| 2051 | localB->XBRUrgency = rtu_Else_f; |
| 2052 | localB->XBRPassThroughEnabled = rtu_Else_k; |
| 2053 | } |
| 2054 | |
| 2055 | /* End of Switch: '<S1039>/Switch' */ |
| 2056 | } |
| 2057 | |
| 2058 | static int32_T safe_cast_to_ENUM_XPR_CONTROL_M(int32_T input) |
| 2059 | { |
| 2060 | int32_T y; |
| 2061 | |
| 2062 | /* Initialize output value to default value for ENUM_XPR_CONTROL_MODE_T (NO_BRAKE_DEMAND) */ |
| 2063 | y = 0; |
| 2064 | if (((input >= 0) && (input <= 3)) || ((input >= 13) && (input <= 15))) { |
| 2065 | /* Set output value to input value if it is a member of ENUM_XPR_CONTROL_MODE_T */ |
| 2066 | y = input; |
| 2067 | } |
| 2068 | |
| 2069 | return y; |
| 2070 | } |
| 2071 | |
| 2072 | static int32_T safe_cast_to_ENUM_XPR_ERROR_STA(int32_T input) |
| 2073 | { |
| 2074 | int32_T y; |
| 2075 | |
| 2076 | /* Initialize output value to default value for ENUM_XPR_ERROR_STATE_T (XPR_OK) */ |
| 2077 | y = 0; |
| 2078 | if ((input >= 0) && (input <= 3)) { |
| 2079 | /* Set output value to input value if it is a member of ENUM_XPR_ERROR_STATE_T */ |
| 2080 | y = input; |
| 2081 | } |
| 2082 | |
| 2083 | return y; |
| 2084 | } |
| 2085 | |
| 2086 | /* Function for Chart: '<S211>/Relay_control_state_machine' */ |
| 2087 | static void L4_MABX_enter_atomic_INITIAL(void) |
| 2088 | { |
| 2089 | /* Entry 'INITIAL': '<S218>:12' */ |
| 2090 | L4_MABX_B.F_Ignition_relay_command_i = false; |
| 2091 | L4_MABX_B.F_Inverter_relay_command_p = false; |
| 2092 | L4_MABX_B.F_MABX_relay_command_n = false; |
| 2093 | L4_MABX_B.F_Sensor_relay_command_k = false; |
| 2094 | L4_MABX_DW.IGN_RELAY_ON_DELAY_SECS_APV = |
| 2095 | L4_MABX_B.TmpSignalConversionAtSFunctionI[0]; |
| 2096 | L4_MABX_DW.INVERTER_RELAY_ON_DELAY_SECS_AP = |
| 2097 | L4_MABX_B.TmpSignalConversionAtSFunctionI[1]; |
| 2098 | L4_MABX_DW.MABX_RELAY_ON_DELAY_SECS_APV = |
| 2099 | L4_MABX_B.TmpSignalConversionAtSFunctionI[2]; |
| 2100 | L4_MABX_DW.SENSOR_RELAY_ON_DELAY_SECS_APV = |
| 2101 | L4_MABX_B.TmpSignalConversionAtSFunctionI[3]; |
| 2102 | L4_MABX_DW.IGN_RELAY_OFF_DELAY_SECS_APV = |
| 2103 | L4_MABX_B.TmpSignalConversionAtSFunctio_k[0]; |
| 2104 | L4_MABX_DW.INVERTER_RELAY_OFF_DELAY_SECS_A = |
| 2105 | L4_MABX_B.TmpSignalConversionAtSFunctio_k[1]; |
| 2106 | L4_MABX_DW.MABX_RELAY_OFF_DELAY_SECS_APV = |
| 2107 | L4_MABX_B.TmpSignalConversionAtSFunctio_k[2]; |
| 2108 | L4_MABX_DW.SENSOR_RELAY_OFF_DELAY_SECS_APV = |
| 2109 | L4_MABX_B.TmpSignalConversionAtSFunctio_k[3]; |
| 2110 | } |
| 2111 | |
| 2112 | real_T rt_atan2d_snf(real_T u0, real_T u1) |
| 2113 | { |
| 2114 | real_T y; |
| 2115 | int32_T tmp; |
| 2116 | int32_T tmp_0; |
| 2117 | if (rtIsNaN(u0) || rtIsNaN(u1)) { |
| 2118 | y = (rtNaN); |
| 2119 | } else if (rtIsInf(u0) && rtIsInf(u1)) { |
| 2120 | if (u1 > 0.0) { |
| 2121 | tmp = 1; |
| 2122 | } else { |
| 2123 | tmp = -1; |
| 2124 | } |
| 2125 | |
| 2126 | if (u0 > 0.0) { |
| 2127 | tmp_0 = 1; |
| 2128 | } else { |
| 2129 | tmp_0 = -1; |
| 2130 | } |
| 2131 | |
| 2132 | y = atan2(tmp_0, tmp); |
| 2133 | } else if (u1 == 0.0) { |
| 2134 | if (u0 > 0.0) { |
| 2135 | y = RT_PI / 2.0; |
| 2136 | } else if (u0 < 0.0) { |
| 2137 | y = -(RT_PI / 2.0); |
| 2138 | } else { |
| 2139 | y = 0.0; |
| 2140 | } |
| 2141 | } else { |
| 2142 | y = atan2(u0, u1); |
| 2143 | } |
| 2144 | |
| 2145 | return y; |
| 2146 | } |
| 2147 | |
| 2148 | real_T rt_powd_snf(real_T u0, real_T u1) |
| 2149 | { |
| 2150 | real_T y; |
| 2151 | real_T tmp; |
| 2152 | real_T tmp_0; |
| 2153 | if (rtIsNaN(u0) || rtIsNaN(u1)) { |
| 2154 | y = (rtNaN); |
| 2155 | } else { |
| 2156 | tmp = fabs(u0); |
| 2157 | tmp_0 = fabs(u1); |
| 2158 | if (rtIsInf(u1)) { |
| 2159 | if (tmp == 1.0) { |
| 2160 | y = 1.0; |
| 2161 | } else if (tmp > 1.0) { |
| 2162 | if (u1 > 0.0) { |
| 2163 | y = (rtInf); |
| 2164 | } else { |
| 2165 | y = 0.0; |
| 2166 | } |
| 2167 | } else if (u1 > 0.0) { |
| 2168 | y = 0.0; |
| 2169 | } else { |
| 2170 | y = (rtInf); |
| 2171 | } |
| 2172 | } else if (tmp_0 == 0.0) { |
| 2173 | y = 1.0; |
| 2174 | } else if (tmp_0 == 1.0) { |
| 2175 | if (u1 > 0.0) { |
| 2176 | y = u0; |
| 2177 | } else { |
| 2178 | y = 1.0 / u0; |
| 2179 | } |
| 2180 | } else if (u1 == 2.0) { |
| 2181 | y = u0 * u0; |
| 2182 | } else if ((u1 == 0.5) && (u0 >= 0.0)) { |
| 2183 | y = sqrt(u0); |
| 2184 | } else if ((u0 < 0.0) && (u1 > floor(u1))) { |
| 2185 | y = (rtNaN); |
| 2186 | } else { |
| 2187 | y = pow(u0, u1); |
| 2188 | } |
| 2189 | } |
| 2190 | |
| 2191 | return y; |
| 2192 | } |
| 2193 | |
| 2194 | /* Function for Chart: '<S344>/VehicleSpeedSetpointDynamicCalculation' */ |
| 2195 | static void L4_MABX_Calculate_abc(void) |
| 2196 | { |
| 2197 | /* MATLAB Function 'Calculate_abc': '<S359>:158' */ |
| 2198 | /* Graphical Function 'Calculate_abc': '<S359>:158' */ |
| 2199 | /* '<S359>:160:1' */ |
| 2200 | L4_MABX_DW.a = L4_MABX_DW.Jerk56 - L4_MABX_DW.Jerk12; |
| 2201 | |
| 2202 | /* '<S359>:160:1' */ |
| 2203 | L4_MABX_DW.b = ((L4_MABX_DW.AccelerationFinalLimited * L4_MABX_DW.Jerk12 - |
| 2204 | L4_MABX_DW.AccelerationInitialLimited * L4_MABX_DW.Jerk56) - |
| 2205 | L4_MABX_DW.Jerk12 * L4_MABX_DW.Jerk56 * L4_MABX_DW.TimeFinal) * |
| 2206 | 2.0; |
| 2207 | |
| 2208 | /* '<S359>:160:3' */ |
| 2209 | L4_MABX_DW.c = (2.0 * L4_MABX_DW.Jerk12 * L4_MABX_DW.Jerk56 * |
| 2210 | (L4_MABX_DW.VelocityFinalLimited - |
| 2211 | L4_MABX_DW.VelocityInitialLimited) + |
| 2212 | L4_MABX_DW.AccelerationInitialLimited * |
| 2213 | L4_MABX_DW.AccelerationInitialLimited * L4_MABX_DW.Jerk56) - |
| 2214 | L4_MABX_DW.AccelerationFinalLimited * L4_MABX_DW.AccelerationFinalLimited * |
| 2215 | L4_MABX_DW.Jerk12; |
| 2216 | } |
| 2217 | |
| 2218 | /* Function for Chart: '<S344>/VehicleSpeedSetpointDynamicCalculation' */ |
| 2219 | static void L4_MABX_CalculateAlternate_abc(void) |
| 2220 | { |
| 2221 | /* MATLAB Function 'CalculateAlternate_abc': '<S359>:286' */ |
| 2222 | /* Graphical Function 'CalculateAlternate_abc': '<S359>:286' */ |
| 2223 | /* '<S359>:285:1' */ |
| 2224 | L4_MABX_DW.a = 1.0; |
| 2225 | |
| 2226 | /* '<S359>:285:1' */ |
| 2227 | L4_MABX_DW.b = ((L4_MABX_DW.TimeFinal - 0.005) * L4_MABX_DW.Jerk56 - |
| 2228 | L4_MABX_DW.AccelerationFinalLimited) * 2.0; |
| 2229 | |
| 2230 | /* '<S359>:285:3' */ |
| 2231 | L4_MABX_DW.c = 2.0 * L4_MABX_DW.Jerk56 * (L4_MABX_DW.VelocityInitialLimited - |
| 2232 | L4_MABX_DW.VelocityFinalLimited) + L4_MABX_DW.AccelerationFinalLimited * |
| 2233 | L4_MABX_DW.AccelerationFinalLimited; |
| 2234 | } |
| 2235 | |
| 2236 | /* Function for Chart: '<S344>/VehicleSpeedSetpointDynamicCalculation' */ |
| 2237 | static void L4_MABX_CalculateAcceleration34(void) |
| 2238 | { |
| 2239 | real_T u; |
| 2240 | real_T u0; |
| 2241 | real_T u1; |
| 2242 | |
| 2243 | /* MATLAB Function 'CalculateAcceleration34': '<S359>:167' */ |
| 2244 | /* Graphical Function 'CalculateAcceleration34': '<S359>:167' */ |
| 2245 | /* '<S359>:186:1' */ |
| 2246 | /* '<S359>:186:5' */ |
| 2247 | /* '<S359>:186:8' */ |
| 2248 | u = L4_MABX_DW.Jerk12; |
| 2249 | if (u < 0.0) { |
| 2250 | u = -1.0; |
| 2251 | } else if (u > 0.0) { |
| 2252 | u = 1.0; |
| 2253 | } else if (u == 0.0) { |
| 2254 | u = 0.0; |
| 2255 | } else { |
| 2256 | u = (rtNaN); |
| 2257 | } |
| 2258 | |
| 2259 | u0 = fabs(L4_MABX_DW.Jerk12); |
| 2260 | u1 = fabs(((((L4_MABX_DW.AccelerationInitialLimited * |
| 2261 | L4_MABX_DW.AccelerationFinalLimited - |
| 2262 | L4_MABX_DW.AccelerationInitialLimited * L4_MABX_DW.Jerk56 * |
| 2263 | L4_MABX_DW.TimeFinal) + (L4_MABX_DW.VelocityFinalLimited - |
| 2264 | L4_MABX_DW.VelocityInitialLimited) * L4_MABX_DW.Jerk56) * 2.0 - |
| 2265 | L4_MABX_DW.AccelerationInitialLimited * |
| 2266 | L4_MABX_DW.AccelerationInitialLimited) - |
| 2267 | L4_MABX_DW.AccelerationFinalLimited * |
| 2268 | L4_MABX_DW.AccelerationFinalLimited) / |
| 2269 | (((L4_MABX_DW.VelocityFinalLimited - |
| 2270 | L4_MABX_DW.VelocityInitialLimited) - |
| 2271 | L4_MABX_DW.AccelerationFinalLimited * L4_MABX_DW.TimeFinal) * 2.0 |
| 2272 | + L4_MABX_DW.TimeFinal * L4_MABX_DW.TimeFinal * L4_MABX_DW.Jerk56)) |
| 2273 | + 0.001; |
| 2274 | if ((u0 > u1) || rtIsNaN(u1)) { |
| 2275 | u1 = u0; |
| 2276 | } |
| 2277 | |
| 2278 | L4_MABX_DW.Jerk12 = u * u1; |
| 2279 | |
| 2280 | /* '<S359>:186:11' */ |
| 2281 | u1 = L4_MABX_DW.Jerk12; |
| 2282 | if ((10.0 < u1) || rtIsNaN(u1)) { |
| 2283 | u1 = 10.0; |
| 2284 | } |
| 2285 | |
| 2286 | if ((-10.0 > u1) || rtIsNaN(u1)) { |
| 2287 | L4_MABX_DW.Jerk12 = -10.0; |
| 2288 | } else { |
| 2289 | L4_MABX_DW.Jerk12 = u1; |
| 2290 | } |
| 2291 | |
| 2292 | /* '<S359>:186:11' */ |
| 2293 | L4_MABX_Calculate_abc(); |
| 2294 | |
| 2295 | /* '<S359>:187:1' */ |
| 2296 | if (fabs(L4_MABX_DW.a) < 0.01) { |
| 2297 | /* '<S359>:188:1' */ |
| 2298 | L4_MABX_DW.Jerk12 = L4_MABX_DW.Jerk56; |
| 2299 | |
| 2300 | /* '<S359>:188:1' */ |
| 2301 | L4_MABX_Calculate_abc(); |
| 2302 | |
| 2303 | /* '<S359>:188:1' */ |
| 2304 | L4_MABX_DW.Acceleration34 = -L4_MABX_DW.c / L4_MABX_DW.b; |
| 2305 | |
| 2306 | /* '<S359>:188:2' */ |
| 2307 | L4_MABX_DW.AlternateMethod = false; |
| 2308 | } else { |
| 2309 | /* '<S359>:224:1' */ |
| 2310 | if (L4_MABX_DW.b * L4_MABX_DW.b <= 4.0 * L4_MABX_DW.a * L4_MABX_DW.c) { |
| 2311 | /* '<S359>:292:1' */ |
| 2312 | L4_MABX_CalculateAlternate_abc(); |
| 2313 | |
| 2314 | /* '<S359>:292:1' */ |
| 2315 | L4_MABX_DW.Acceleration34 = -L4_MABX_DW.b / (2.0 * L4_MABX_DW.a); |
| 2316 | |
| 2317 | /* '<S359>:292:2' */ |
| 2318 | L4_MABX_DW.AlternateMethod = true; |
| 2319 | } else { |
| 2320 | /* '<S359>:294:1' */ |
| 2321 | L4_MABX_DW.Acceleration34 = (sqrt(L4_MABX_DW.b * L4_MABX_DW.b - 4.0 * |
| 2322 | L4_MABX_DW.a * L4_MABX_DW.c) + -L4_MABX_DW.b) / (2.0 * L4_MABX_DW.a); |
| 2323 | |
| 2324 | /* '<S359>:294:2' */ |
| 2325 | L4_MABX_DW.AlternateMethod = false; |
| 2326 | } |
| 2327 | } |
| 2328 | } |
| 2329 | |
| 2330 | static int32_T safe_cast_to_ENUM_CAN_STATUS_DI(int32_T input) |
| 2331 | { |
| 2332 | int32_T y; |
| 2333 | |
| 2334 | /* Initialize output value to default value for ENUM_CAN_STATUS_DIAG_T (ACTIVE) */ |
| 2335 | y = 0; |
| 2336 | if ((input >= 0) && (input <= 2)) { |
| 2337 | /* Set output value to input value if it is a member of ENUM_CAN_STATUS_DIAG_T */ |
| 2338 | y = input; |
| 2339 | } |
| 2340 | |
| 2341 | return y; |
| 2342 | } |
| 2343 | |
| 2344 | /* Model output function for TID0 */ |
| 2345 | void L4_MABX_output0(void) /* Sample time: [0.01s, 0.0s] */ |
| 2346 | { |
| 2347 | int_T tid = 0; |
| 2348 | uint8_T starting_index; |
| 2349 | real_T AccelerationAverage; |
| 2350 | real_T DeltaTimeFinal; |
| 2351 | uint8_T j; |
| 2352 | real_T PositionFinalLimited; |
| 2353 | real_T Time56; |
| 2354 | real_T DeltaTime; |
| 2355 | uint32_T tmp; |
| 2356 | boolean_T zcEvent; |
| 2357 | int32_T i; |
| 2358 | uint32_T q0; |
| 2359 | uint16_T tmp_0; |
| 2360 | int8_T tmp_1; |
| 2361 | |
| 2362 | /* Update the flag to indicate when data transfers from |
| 2363 | * Sample time: [0.01s, 0.0s] to Sample time: [0.02s, 0.0s] */ |
| 2364 | L4_MABX_M->Timing.perTaskSampleHits[1] = |
| 2365 | (L4_MABX_M->Timing.RateInteraction.TID0_1 == 0); |
| 2366 | (L4_MABX_M->Timing.RateInteraction.TID0_1)++; |
| 2367 | if ((L4_MABX_M->Timing.RateInteraction.TID0_1) > 1) { |
| 2368 | L4_MABX_M->Timing.RateInteraction.TID0_1 = 0; |
| 2369 | } |
| 2370 | |
| 2371 | /* Update the flag to indicate when data transfers from |
| 2372 | * Sample time: [0.01s, 0.0s] to Sample time: [0.05s, 0.0s] */ |
| 2373 | L4_MABX_M->Timing.perTaskSampleHits[2] = |
| 2374 | (L4_MABX_M->Timing.RateInteraction.TID0_2 == 0); |
| 2375 | (L4_MABX_M->Timing.RateInteraction.TID0_2)++; |
| 2376 | if ((L4_MABX_M->Timing.RateInteraction.TID0_2) > 4) { |
| 2377 | L4_MABX_M->Timing.RateInteraction.TID0_2 = 0; |
| 2378 | } |
| 2379 | |
| 2380 | /* Update the flag to indicate when data transfers from |
| 2381 | * Sample time: [0.01s, 0.0s] to Sample time: [0.1s, 0.0s] */ |
| 2382 | L4_MABX_M->Timing.perTaskSampleHits[3] = |
| 2383 | (L4_MABX_M->Timing.RateInteraction.TID0_3 == 0); |
| 2384 | (L4_MABX_M->Timing.RateInteraction.TID0_3)++; |
| 2385 | if ((L4_MABX_M->Timing.RateInteraction.TID0_3) > 9) { |
| 2386 | L4_MABX_M->Timing.RateInteraction.TID0_3 = 0; |
| 2387 | } |
| 2388 | |
| 2389 | /* Update the flag to indicate when data transfers from |
| 2390 | * Sample time: [0.01s, 0.0s] to Sample time: [1.0s, 0.0s] */ |
| 2391 | L4_MABX_M->Timing.perTaskSampleHits[6] = |
| 2392 | (L4_MABX_M->Timing.RateInteraction.TID0_6 == 0); |
| 2393 | (L4_MABX_M->Timing.RateInteraction.TID0_6)++; |
| 2394 | if ((L4_MABX_M->Timing.RateInteraction.TID0_6) > 99) { |
| 2395 | L4_MABX_M->Timing.RateInteraction.TID0_6 = 0; |
| 2396 | } |
| 2397 | |
| 2398 | /* Update the flag to indicate when data transfers from |
| 2399 | * Sample time: [0.01s, 0.0s] to Sample time: [5.0s, 0.0s] */ |
| 2400 | L4_MABX_M->Timing.perTaskSampleHits[7] = |
| 2401 | (L4_MABX_M->Timing.RateInteraction.TID0_7 == 0); |
| 2402 | (L4_MABX_M->Timing.RateInteraction.TID0_7)++; |
| 2403 | if ((L4_MABX_M->Timing.RateInteraction.TID0_7) > 499) { |
| 2404 | L4_MABX_M->Timing.RateInteraction.TID0_7 = 0; |
| 2405 | } |
| 2406 | |
| 2407 | /* Outputs for Enabled SubSystem: '<S497>/AIR1' incorporates: |
| 2408 | * EnablePort: '<S498>/Enable' |
| 2409 | */ |
| 2410 | /* Constant: '<S425>/Constant' */ |
| 2411 | if (L4_MABX_P.Constant_Value_b1) { |
| 2412 | /* S-Function (rti_commonblock): '<S498>/S-Function1' */ |
| 2413 | /* This comment workarounds a code generation problem */ |
| 2414 | |
| 2415 | /* dSPACE RTICAN RX Message Block: "AIR1" Id:419343921 */ |
| 2416 | { |
| 2417 | UInt32 *CAN_Msg; |
| 2418 | static dsfloat time_old = 0.0; |
| 2419 | |
| 2420 | /* Read status and timestamp info (previous message) */ |
| 2421 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEAE31].timestamp != |
| 2422 | time_old) { |
| 2423 | /* ... save timestamp info for the calculation of the RX status |
| 2424 | during the consecutive sample hit*/ |
| 2425 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEAE31]. |
| 2426 | timestamp; |
| 2427 | |
| 2428 | /* ... set the processed flag to one */ |
| 2429 | L4_MABX_B.SFunction1_o9_af = 1.0; |
| 2430 | L4_MABX_B.SFunction1_o10_j = (real_T) |
| 2431 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEAE31].timestamp; |
| 2432 | L4_MABX_B.SFunction1_o11_kj = (real_T) |
| 2433 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEAE31].deltatime; |
| 2434 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEAE31].data; |
| 2435 | |
| 2436 | /* Decode CAN message */ |
| 2437 | { |
| 2438 | { |
| 2439 | rtican_Signal_t CAN_Sgn; |
| 2440 | |
| 2441 | /* ...... "PneumaticSupplyPress" (0|8, standard signal, unsigned int, little endian) */ |
| 2442 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 2443 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2444 | L4_MABX_B.SFunction1_o1_ce = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2445 | |
| 2446 | /* ...... "ParkingAnd_orTrailerAirPress" (8|8, standard signal, unsigned int, little endian) */ |
| 2447 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 2448 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2449 | L4_MABX_B.SFunction1_o2_c4 = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2450 | |
| 2451 | /* ...... "ServiceBrakeCircuit1AirPress" (16|8, standard signal, unsigned int, little endian) */ |
| 2452 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 2453 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2454 | L4_MABX_B.SFunction1_o3_ik = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2455 | |
| 2456 | /* ...... "ServiceBrakeCircuit2AirPress" (24|8, standard signal, unsigned int, little endian) */ |
| 2457 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 2458 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2459 | L4_MABX_B.SFunction1_o4_nj = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2460 | |
| 2461 | /* ...... "AuxEquipmentSupplyPress" (32|8, standard signal, unsigned int, little endian) */ |
| 2462 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 2463 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2464 | L4_MABX_B.SFunction1_o5_oy = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2465 | |
| 2466 | /* ...... "AirSuspensionSupplyPress" (40|8, standard signal, unsigned int, little endian) */ |
| 2467 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 2468 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2469 | L4_MABX_B.SFunction1_o6_bo = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2470 | |
| 2471 | /* ...... "AirCompressorStatus" (48|2, standard signal, unsigned int, little endian) */ |
| 2472 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 2473 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 2474 | L4_MABX_B.SFunction1_o7_fu = ((real_T) CAN_Sgn.UnsignedSgn); |
| 2475 | |
| 2476 | /* ...... "PowertrainCircuitAirSupplyPress" (56|8, standard signal, unsigned int, little endian) */ |
| 2477 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 2478 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2479 | L4_MABX_B.SFunction1_o8_an = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2480 | } |
| 2481 | } |
| 2482 | } else { |
| 2483 | /* set RX status to 0 because no new message has arrived */ |
| 2484 | L4_MABX_B.SFunction1_o9_af = 0.0; |
| 2485 | } |
| 2486 | } |
| 2487 | } |
| 2488 | |
| 2489 | /* End of Constant: '<S425>/Constant' */ |
| 2490 | /* End of Outputs for SubSystem: '<S497>/AIR1' */ |
| 2491 | |
| 2492 | /* Outputs for Enabled SubSystem: '<S499>/AMB' incorporates: |
| 2493 | * EnablePort: '<S500>/Enable' |
| 2494 | */ |
| 2495 | /* Constant: '<S426>/Constant' */ |
| 2496 | if (L4_MABX_P.Constant_Value_f2) { |
| 2497 | /* S-Function (rti_commonblock): '<S500>/S-Function1' */ |
| 2498 | /* This comment workarounds a code generation problem */ |
| 2499 | |
| 2500 | /* dSPACE RTICAN RX Message Block: "AMB" Id:419362048 */ |
| 2501 | { |
| 2502 | UInt32 *CAN_Msg; |
| 2503 | static dsfloat time_old = 0.0; |
| 2504 | |
| 2505 | /* Read status and timestamp info (previous message) */ |
| 2506 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF500].timestamp != |
| 2507 | time_old) { |
| 2508 | /* ... save timestamp info for the calculation of the RX status |
| 2509 | during the consecutive sample hit*/ |
| 2510 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF500]. |
| 2511 | timestamp; |
| 2512 | |
| 2513 | /* ... set the processed flag to one */ |
| 2514 | L4_MABX_B.SFunction1_o6_ee = 1.0; |
| 2515 | L4_MABX_B.SFunction1_o7_as = (real_T) |
| 2516 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF500].timestamp; |
| 2517 | L4_MABX_B.SFunction1_o8_gn = (real_T) |
| 2518 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF500].deltatime; |
| 2519 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF500].data; |
| 2520 | |
| 2521 | /* Decode CAN message */ |
| 2522 | { |
| 2523 | { |
| 2524 | rtican_Signal_t CAN_Sgn; |
| 2525 | |
| 2526 | /* ...... "BarometricPress" (0|8, standard signal, unsigned int, little endian) */ |
| 2527 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 2528 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2529 | L4_MABX_B.SFunction1_o1_ps = 0.5 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2530 | |
| 2531 | /* ...... "CabInteriorTemp" (8|16, standard signal, unsigned int, little endian) */ |
| 2532 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 2533 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 2534 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 2535 | L4_MABX_B.SFunction1_o2_hy = -273 + ( 0.03125 * ( ((real_T) |
| 2536 | CAN_Sgn.UnsignedSgn) ) ); |
| 2537 | |
| 2538 | /* ...... "AmbientAirTemp" (24|16, standard signal, unsigned int, little endian) */ |
| 2539 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 2540 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 2541 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 2542 | L4_MABX_B.SFunction1_o3_b1 = -273 + ( 0.03125 * ( ((real_T) |
| 2543 | CAN_Sgn.UnsignedSgn) ) ); |
| 2544 | |
| 2545 | /* ...... "EngAirIntakeTemp" (40|8, standard signal, unsigned int, little endian) */ |
| 2546 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 2547 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 2548 | L4_MABX_B.SFunction1_o4_c0 = -40 + ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 2549 | |
| 2550 | /* ...... "RoadSurfaceTemp" (48|16, standard signal, unsigned int, little endian) */ |
| 2551 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 2552 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[7]; |
| 2553 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 2554 | L4_MABX_B.SFunction1_o5_dq = -273 + ( 0.03125 * ( ((real_T) |
| 2555 | CAN_Sgn.UnsignedSgn) ) ); |
| 2556 | } |
| 2557 | } |
| 2558 | } else { |
| 2559 | /* set RX status to 0 because no new message has arrived */ |
| 2560 | L4_MABX_B.SFunction1_o6_ee = 0.0; |
| 2561 | } |
| 2562 | } |
| 2563 | } |
| 2564 | |
| 2565 | /* End of Constant: '<S426>/Constant' */ |
| 2566 | /* End of Outputs for SubSystem: '<S499>/AMB' */ |
| 2567 | |
| 2568 | /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_1000ms' */ |
| 2569 | |
| 2570 | /* RateTransition: '<S869>/TmpRTBAtAIR1Inport1' */ |
| 2571 | if (L4_MABX_M->Timing.RateInteraction.TID0_6 == 1) { |
| 2572 | L4_MABX_B.PneumaticSupplyPress = L4_MABX_B.SFunction1_o1_ce; |
| 2573 | L4_MABX_B.ParkingAnd_orTrailerAirPress = L4_MABX_B.SFunction1_o2_c4; |
| 2574 | L4_MABX_B.ServiceBrakeCircuit1AirPress = L4_MABX_B.SFunction1_o3_ik; |
| 2575 | L4_MABX_B.ServiceBrakeCircuit2AirPress = L4_MABX_B.SFunction1_o4_nj; |
| 2576 | L4_MABX_B.AuxEquipmentSupplyPress = L4_MABX_B.SFunction1_o5_oy; |
| 2577 | L4_MABX_B.AirSuspensionSupplyPress = L4_MABX_B.SFunction1_o6_bo; |
| 2578 | L4_MABX_B.AirCompressorStatus = L4_MABX_B.SFunction1_o7_fu; |
| 2579 | L4_MABX_B.PowertrainCircuitAirSupplyPress = L4_MABX_B.SFunction1_o8_an; |
| 2580 | L4_MABX_B.BarometricPress_n = L4_MABX_B.SFunction1_o1_ps; |
| 2581 | L4_MABX_B.CabInteriorTemp = L4_MABX_B.SFunction1_o2_hy; |
| 2582 | L4_MABX_B.AmbientAirTemp_a = L4_MABX_B.SFunction1_o3_b1; |
| 2583 | L4_MABX_B.EngAirIntakeTemp = L4_MABX_B.SFunction1_o4_c0; |
| 2584 | L4_MABX_B.RoadSurfaceTemp = L4_MABX_B.SFunction1_o5_dq; |
| 2585 | } |
| 2586 | |
| 2587 | /* End of Outputs for SubSystem: '<S849>/CAN_TX_1000ms' */ |
| 2588 | |
| 2589 | /* S-Function (rti_commonblock): '<S734>/S-Function1' */ |
| 2590 | /* This comment workarounds a code generation problem */ |
| 2591 | |
| 2592 | /* DataTypeConversion: '<S416>/EStopSwActive' */ |
| 2593 | L4_MABX_B.EStopSwActive = L4_MABX_B.SFunction1_as; |
| 2594 | |
| 2595 | /* Logic: '<S416>/Logical Operator1' */ |
| 2596 | EStop = !L4_MABX_B.EStopSwActive; |
| 2597 | |
| 2598 | /* S-Function (rti_commonblock): '<S733>/S-Function1' */ |
| 2599 | /* This comment workarounds a code generation problem */ |
| 2600 | |
| 2601 | /* S-Function (sfix_bitop): '<S843>/Operator' */ |
| 2602 | L4_MABX_B.Operator_mg = (L4_MABX_B.SFunction1_bb && |
| 2603 | (L4_MABX_P.Operator_BitMask_m2 != 0)); |
| 2604 | |
| 2605 | /* DataTypeConversion: '<S843>/DataType' */ |
| 2606 | L4_MABX_B.DataType_ku = L4_MABX_B.Operator_mg; |
| 2607 | |
| 2608 | /* Logic: '<S745>/Logical Operator' */ |
| 2609 | L4_MABX_B.LogicalOperator = !L4_MABX_B.DataType_ku; |
| 2610 | |
| 2611 | /* S-Function (rti_commonblock): '<S735>/S-Function1' */ |
| 2612 | /* This comment workarounds a code generation problem */ |
| 2613 | |
| 2614 | /* S-Function (sfix_bitop): '<S844>/Operator' */ |
| 2615 | L4_MABX_B.Operator_cci = (L4_MABX_B.SFunction1_m && |
| 2616 | (L4_MABX_P.Operator_BitMask_jw != 0)); |
| 2617 | |
| 2618 | /* DataTypeConversion: '<S844>/DataType' */ |
| 2619 | L4_MABX_B.DataType_cv = L4_MABX_B.Operator_cci; |
| 2620 | |
| 2621 | /* Logic: '<S745>/AND2' */ |
| 2622 | L4_MABX_B.AND2 = (L4_MABX_B.LogicalOperator && L4_MABX_B.DataType_cv); |
| 2623 | |
| 2624 | /* Chart: '<S845>/Chart' */ |
| 2625 | /* Gateway: DIGITAL/Signal Check/RationalityCheck/Chart */ |
| 2626 | /* During: DIGITAL/Signal Check/RationalityCheck/Chart */ |
| 2627 | if (L4_MABX_DW.is_active_c5_SUB_ECU_L4_MABX_HW == 0U) { |
| 2628 | /* Entry: DIGITAL/Signal Check/RationalityCheck/Chart */ |
| 2629 | L4_MABX_DW.is_active_c5_SUB_ECU_L4_MABX_HW = 1U; |
| 2630 | |
| 2631 | /* Entry Internal: DIGITAL/Signal Check/RationalityCheck/Chart */ |
| 2632 | /* Transition: '<S846>:6' */ |
| 2633 | L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_init_l; |
| 2634 | |
| 2635 | /* Entry 'init': '<S846>:1' */ |
| 2636 | L4_MABX_B.DiagPassed = false; |
| 2637 | } else { |
| 2638 | switch (L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf) { |
| 2639 | case L4_MABX_IN_DiagPassed: |
| 2640 | /* During 'DiagPassed': '<S846>:4' */ |
| 2641 | break; |
| 2642 | |
| 2643 | case L4_MABX_IN_SwitchOff: |
| 2644 | /* During 'SwitchOff': '<S846>:2' */ |
| 2645 | if (L4_MABX_B.AND2) { |
| 2646 | /* Transition: '<S846>:8' */ |
| 2647 | L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_DiagPassed; |
| 2648 | |
| 2649 | /* Entry 'DiagPassed': '<S846>:4' */ |
| 2650 | L4_MABX_B.DiagPassed = true; |
| 2651 | } |
| 2652 | break; |
| 2653 | |
| 2654 | case L4_MABX_IN_SwitchOn: |
| 2655 | /* During 'SwitchOn': '<S846>:3' */ |
| 2656 | if (!L4_MABX_B.AND2) { |
| 2657 | /* Transition: '<S846>:9' */ |
| 2658 | L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SwitchOff; |
| 2659 | } |
| 2660 | break; |
| 2661 | |
| 2662 | default: |
| 2663 | /* During 'init': '<S846>:1' */ |
| 2664 | if (!L4_MABX_B.AND2) { |
| 2665 | /* Transition: '<S846>:5' */ |
| 2666 | L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SwitchOff; |
| 2667 | } else { |
| 2668 | /* Transition: '<S846>:7' */ |
| 2669 | L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SwitchOn; |
| 2670 | } |
| 2671 | break; |
| 2672 | } |
| 2673 | } |
| 2674 | |
| 2675 | /* End of Chart: '<S845>/Chart' */ |
| 2676 | |
| 2677 | /* Switch: '<S745>/Switch' incorporates: |
| 2678 | * Constant: '<S745>/OverrideOperatorEnableSW_Default' |
| 2679 | */ |
| 2680 | if (L4_MABX_B.DiagPassed) { |
| 2681 | EnableSw = L4_MABX_B.AND2; |
| 2682 | } else { |
| 2683 | EnableSw = L4_MABX_P.OverrideOperatorEnableSW_Defaul; |
| 2684 | } |
| 2685 | |
| 2686 | /* End of Switch: '<S745>/Switch' */ |
| 2687 | |
| 2688 | /* UnitDelay: '<S757>/Unit Delay' */ |
| 2689 | L4_MABX_B.UnitDelay = L4_MABX_DW.UnitDelay_DSTATE; |
| 2690 | |
| 2691 | /* S-Function (rti_commonblock): '<S736>/S-Function1' */ |
| 2692 | /* This comment workarounds a code generation problem */ |
| 2693 | |
| 2694 | /* DataTypeConversion: '<S416>/StartPBActive' */ |
| 2695 | L4_MABX_B.StartPBActive = L4_MABX_B.SFunction1_o; |
| 2696 | |
| 2697 | /* Logic: '<S416>/Logical Operator' */ |
| 2698 | L4_MABX_B.LogicalOperator_j = !L4_MABX_B.StartPBActive; |
| 2699 | |
| 2700 | /* RelationalOperator: '<S759>/Compare' incorporates: |
| 2701 | * Constant: '<S759>/Constant' |
| 2702 | */ |
| 2703 | L4_MABX_B.Compare = ((int32_T)L4_MABX_B.LogicalOperator_j > (int32_T) |
| 2704 | L4_MABX_P.Constant_Value_np); |
| 2705 | |
| 2706 | /* UnitDelay: '<S755>/Delay Input1' */ |
| 2707 | L4_MABX_B.Uk1_f = L4_MABX_DW.DelayInput1_DSTATE_g; |
| 2708 | |
| 2709 | /* RelationalOperator: '<S755>/FixPt Relational Operator' */ |
| 2710 | L4_MABX_B.FixPtRelationalOperator = ((int32_T)L4_MABX_B.Compare > (int32_T) |
| 2711 | L4_MABX_B.Uk1_f); |
| 2712 | |
| 2713 | /* UnitDelay: '<S756>/Unit Delay' */ |
| 2714 | L4_MABX_B.UnitDelay_o = L4_MABX_DW.UnitDelay_DSTATE_i; |
| 2715 | |
| 2716 | /* UnitDelay: '<S743>/Unit Delay' */ |
| 2717 | L4_MABX_B.UnitDelay_gw = L4_MABX_DW.UnitDelay_DSTATE_ms; |
| 2718 | |
| 2719 | /* RelationalOperator: '<S758>/Compare' incorporates: |
| 2720 | * Constant: '<S758>/Constant' |
| 2721 | */ |
| 2722 | L4_MABX_B.Compare_p = ((int32_T)L4_MABX_B.UnitDelay_gw <= (int32_T) |
| 2723 | L4_MABX_P.Constant_Value_ho); |
| 2724 | |
| 2725 | /* UnitDelay: '<S754>/Delay Input1' */ |
| 2726 | L4_MABX_B.Uk1_b1 = L4_MABX_DW.DelayInput1_DSTATE_m; |
| 2727 | |
| 2728 | /* RelationalOperator: '<S754>/FixPt Relational Operator' */ |
| 2729 | L4_MABX_B.FixPtRelationalOperator_g = ((int32_T)L4_MABX_B.Compare_p > (int32_T) |
| 2730 | L4_MABX_B.Uk1_b1); |
| 2731 | |
| 2732 | /* UnitDelay: '<S756>/Unit Delay1' */ |
| 2733 | L4_MABX_B.UnitDelay1_d = L4_MABX_DW.UnitDelay1_DSTATE_bf; |
| 2734 | |
| 2735 | /* Logic: '<S756>/OR1' */ |
| 2736 | L4_MABX_B.OR1 = (L4_MABX_B.FixPtRelationalOperator_g || L4_MABX_B.UnitDelay1_d); |
| 2737 | |
| 2738 | /* Switch: '<S756>/Switch' incorporates: |
| 2739 | * Constant: '<S756>/Constant0' |
| 2740 | */ |
| 2741 | if (L4_MABX_B.OR1) { |
| 2742 | /* Sum: '<S756>/Sum' incorporates: |
| 2743 | * Constant: '<S756>/Constant1' |
| 2744 | */ |
| 2745 | L4_MABX_B.Sum_i = L4_MABX_B.UnitDelay_o + L4_MABX_P.Constant1_Value_ed; |
| 2746 | L4_MABX_B.Switch = L4_MABX_B.Sum_i; |
| 2747 | } else { |
| 2748 | L4_MABX_B.Switch = L4_MABX_P.Constant0_Value_d; |
| 2749 | } |
| 2750 | |
| 2751 | /* End of Switch: '<S756>/Switch' */ |
| 2752 | |
| 2753 | /* RelationalOperator: '<S760>/Compare' incorporates: |
| 2754 | * Constant: '<S760>/Constant' |
| 2755 | */ |
| 2756 | L4_MABX_B.Compare_o = (L4_MABX_B.Switch > L4_MABX_P.Constant_Value_c); |
| 2757 | |
| 2758 | /* Gain: '<S756>/Gain' incorporates: |
| 2759 | * Constant: '<S416>/Constant3' |
| 2760 | */ |
| 2761 | L4_MABX_B.Gain = L4_MABX_P.Gain_Gain_h * L4_MABX_P.Constant3_Value_m; |
| 2762 | |
| 2763 | /* RelationalOperator: '<S756>/LessThanOrEqual' */ |
| 2764 | L4_MABX_B.LessThanOrEqual = (L4_MABX_B.Switch <= L4_MABX_B.Gain); |
| 2765 | |
| 2766 | /* Logic: '<S756>/AND' */ |
| 2767 | L4_MABX_B.AND = (L4_MABX_B.Compare_o && L4_MABX_B.LessThanOrEqual); |
| 2768 | |
| 2769 | /* Logic: '<S743>/NOT' */ |
| 2770 | L4_MABX_B.NOT = !L4_MABX_B.AND; |
| 2771 | |
| 2772 | /* Logic: '<S743>/AND' */ |
| 2773 | L4_MABX_B.AND_m = (L4_MABX_B.FixPtRelationalOperator && L4_MABX_B.NOT); |
| 2774 | |
| 2775 | /* UnitDelay: '<S757>/Unit Delay1' */ |
| 2776 | L4_MABX_B.UnitDelay1_g = L4_MABX_DW.UnitDelay1_DSTATE_e; |
| 2777 | |
| 2778 | /* Logic: '<S757>/OR1' */ |
| 2779 | L4_MABX_B.OR1_c = (L4_MABX_B.AND_m || L4_MABX_B.UnitDelay1_g); |
| 2780 | |
| 2781 | /* Switch: '<S757>/Switch' incorporates: |
| 2782 | * Constant: '<S757>/Constant0' |
| 2783 | */ |
| 2784 | if (L4_MABX_B.OR1_c) { |
| 2785 | /* Sum: '<S757>/Sum' incorporates: |
| 2786 | * Constant: '<S757>/Constant1' |
| 2787 | */ |
| 2788 | L4_MABX_B.Sum = L4_MABX_B.UnitDelay + L4_MABX_P.Constant1_Value_ml; |
| 2789 | L4_MABX_B.Switch_p = L4_MABX_B.Sum; |
| 2790 | } else { |
| 2791 | L4_MABX_B.Switch_p = L4_MABX_P.Constant0_Value_m; |
| 2792 | } |
| 2793 | |
| 2794 | /* End of Switch: '<S757>/Switch' */ |
| 2795 | |
| 2796 | /* RelationalOperator: '<S761>/Compare' incorporates: |
| 2797 | * Constant: '<S761>/Constant' |
| 2798 | */ |
| 2799 | L4_MABX_B.Compare_m = (L4_MABX_B.Switch_p > L4_MABX_P.Constant_Value_cr); |
| 2800 | |
| 2801 | /* Gain: '<S757>/Gain' incorporates: |
| 2802 | * Constant: '<S416>/Constant2' |
| 2803 | */ |
| 2804 | L4_MABX_B.Gain_n = L4_MABX_P.Gain_Gain_b * L4_MABX_P.Constant2_Value_hx; |
| 2805 | |
| 2806 | /* RelationalOperator: '<S757>/LessThanOrEqual' */ |
| 2807 | L4_MABX_B.LessThanOrEqual_d = (L4_MABX_B.Switch_p <= L4_MABX_B.Gain_n); |
| 2808 | |
| 2809 | /* Logic: '<S757>/AND' */ |
| 2810 | L4_MABX_B.AND_f = (L4_MABX_B.Compare_m && L4_MABX_B.LessThanOrEqual_d); |
| 2811 | |
| 2812 | /* Logic: '<S743>/AND2' */ |
| 2813 | EngagePB = (L4_MABX_B.AND_f && L4_MABX_B.NOT); |
| 2814 | |
| 2815 | /* S-Function (rti_commonblock): '<S738>/S-Function1' */ |
| 2816 | /* This comment workarounds a code generation problem */ |
| 2817 | |
| 2818 | /* DataTypeConversion: '<S416>/StartPBActive1' */ |
| 2819 | L4_MABX_B.StartPBActive1 = L4_MABX_B.SFunction1_c; |
| 2820 | |
| 2821 | /* Logic: '<S416>/Logical Operator3' */ |
| 2822 | BrakeSW = !L4_MABX_B.StartPBActive1; |
| 2823 | |
| 2824 | /* S-Function (rti_commonblock): '<S740>/S-Function1' */ |
| 2825 | /* This comment workarounds a code generation problem */ |
| 2826 | |
| 2827 | /* DataTypeConversion: '<S416>/Data Type Conversion2' */ |
| 2828 | L4_MABX_B.Pedal_1_pwm_freq_raw_value = L4_MABX_B.SFunction1_o1; |
| 2829 | |
| 2830 | /* RelationalOperator: '<S791>/min_relop' incorporates: |
| 2831 | * Constant: '<S763>/PWMAFreqRngMin' |
| 2832 | */ |
| 2833 | L4_MABX_B.min_relop = (L4_MABX_P.PWMAFreqRngMin_Value < |
| 2834 | L4_MABX_B.Pedal_1_pwm_freq_raw_value); |
| 2835 | |
| 2836 | /* RelationalOperator: '<S791>/max_relop' incorporates: |
| 2837 | * Constant: '<S763>/PWMAFreqRngMax' |
| 2838 | */ |
| 2839 | L4_MABX_B.max_relop = (L4_MABX_B.Pedal_1_pwm_freq_raw_value < |
| 2840 | L4_MABX_P.PWMAFreqRngMax_Value); |
| 2841 | |
| 2842 | /* Logic: '<S791>/conjunction' */ |
| 2843 | L4_MABX_B.conjunction = (L4_MABX_B.min_relop && L4_MABX_B.max_relop); |
| 2844 | |
| 2845 | /* UnitDelay: '<S796>/FixPt Unit Delay2' */ |
| 2846 | L4_MABX_B.FixPtUnitDelay2 = L4_MABX_DW.FixPtUnitDelay2_DSTATE; |
| 2847 | |
| 2848 | /* UnitDelay: '<S796>/FixPt Unit Delay1' */ |
| 2849 | L4_MABX_B.Xold = L4_MABX_DW.FixPtUnitDelay1_DSTATE; |
| 2850 | |
| 2851 | /* Switch: '<S796>/Init' incorporates: |
| 2852 | * Constant: '<S763>/PWMAFreqRngFaultLimMin' |
| 2853 | */ |
| 2854 | if (L4_MABX_B.FixPtUnitDelay2 != 0) { |
| 2855 | L4_MABX_B.Init = L4_MABX_P.PWMAFreqRngFaultLimMin_Value; |
| 2856 | } else { |
| 2857 | L4_MABX_B.Init = L4_MABX_B.Xold; |
| 2858 | } |
| 2859 | |
| 2860 | /* End of Switch: '<S796>/Init' */ |
| 2861 | |
| 2862 | /* Sum: '<S792>/FixPt Sum1' incorporates: |
| 2863 | * Constant: '<S792>/FixPt Constant' |
| 2864 | */ |
| 2865 | L4_MABX_B.FixPtSum1 = L4_MABX_B.Init - L4_MABX_P.FixPtConstant_Value_k; |
| 2866 | |
| 2867 | /* Sum: '<S795>/FixPt Sum1' incorporates: |
| 2868 | * Constant: '<S795>/FixPt Constant' |
| 2869 | */ |
| 2870 | L4_MABX_B.FixPtSum1_f = L4_MABX_B.Init + L4_MABX_P.FixPtConstant_Value_f; |
| 2871 | |
| 2872 | /* Outputs for Atomic SubSystem: '<S779>/If_Then_Else3' */ |
| 2873 | L4_MABX_If_Then_Else(L4_MABX_B.conjunction, L4_MABX_B.FixPtSum1, |
| 2874 | L4_MABX_B.FixPtSum1_f, &L4_MABX_B.If_Then_Else3_o); |
| 2875 | |
| 2876 | /* End of Outputs for SubSystem: '<S779>/If_Then_Else3' */ |
| 2877 | |
| 2878 | /* RelationalOperator: '<S793>/Relational Operator1' incorporates: |
| 2879 | * Constant: '<S763>/PWMAFreqRngFaultLimMax' |
| 2880 | */ |
| 2881 | L4_MABX_B.RelationalOperator1 = (L4_MABX_B.If_Then_Else3_o.Switch >= |
| 2882 | L4_MABX_P.PWMAFreqRngFaultLimMax_Value); |
| 2883 | |
| 2884 | /* RelationalOperator: '<S793>/Relational Operator' incorporates: |
| 2885 | * Constant: '<S763>/PWMAFreqRngFaultLimMin' |
| 2886 | */ |
| 2887 | L4_MABX_B.RelationalOperator = (L4_MABX_B.If_Then_Else3_o.Switch <= |
| 2888 | L4_MABX_P.PWMAFreqRngFaultLimMin_Value); |
| 2889 | |
| 2890 | /* Outputs for Atomic SubSystem: '<S793>/If_Then_Else1' */ |
| 2891 | |
| 2892 | /* Constant: '<S763>/PWMAFreqRngFaultLimMin' */ |
| 2893 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator, |
| 2894 | L4_MABX_P.PWMAFreqRngFaultLimMin_Value, |
| 2895 | L4_MABX_B.If_Then_Else3_o.Switch, |
| 2896 | &L4_MABX_B.If_Then_Else1_k); |
| 2897 | |
| 2898 | /* End of Outputs for SubSystem: '<S793>/If_Then_Else1' */ |
| 2899 | |
| 2900 | /* Outputs for Atomic SubSystem: '<S793>/If_Then_Else' */ |
| 2901 | |
| 2902 | /* Constant: '<S763>/PWMAFreqRngFaultLimMax' */ |
| 2903 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1, |
| 2904 | L4_MABX_P.PWMAFreqRngFaultLimMax_Value, |
| 2905 | L4_MABX_B.If_Then_Else1_k.Switch, |
| 2906 | &L4_MABX_B.If_Then_Else_m); |
| 2907 | |
| 2908 | /* End of Outputs for SubSystem: '<S793>/If_Then_Else' */ |
| 2909 | |
| 2910 | /* RelationalOperator: '<S779>/Relational Operator9' incorporates: |
| 2911 | * Constant: '<S763>/PWMAFreqRngFaultLimMin' |
| 2912 | */ |
| 2913 | L4_MABX_B.F_Fault_Soft = (L4_MABX_B.If_Then_Else_m.Switch != |
| 2914 | L4_MABX_P.PWMAFreqRngFaultLimMin_Value); |
| 2915 | |
| 2916 | /* Gain: '<S416>/Gain' */ |
| 2917 | L4_MABX_B.Gain_k = L4_MABX_P.Gain_Gain_k * L4_MABX_B.SFunction1_o2; |
| 2918 | |
| 2919 | /* DataTypeConversion: '<S416>/Data Type Conversion9' */ |
| 2920 | L4_MABX_B.Pedal_1_pwm_dc_raw_value = L4_MABX_B.Gain_k; |
| 2921 | |
| 2922 | /* RelationalOperator: '<S783>/min_relop' incorporates: |
| 2923 | * Constant: '<S763>/PWMADCRngMin' |
| 2924 | */ |
| 2925 | L4_MABX_B.min_relop_c = (L4_MABX_P.PWMADCRngMin_Value < |
| 2926 | L4_MABX_B.Pedal_1_pwm_dc_raw_value); |
| 2927 | |
| 2928 | /* RelationalOperator: '<S783>/max_relop' incorporates: |
| 2929 | * Constant: '<S763>/PWMADCRngMax' |
| 2930 | */ |
| 2931 | L4_MABX_B.max_relop_g = (L4_MABX_B.Pedal_1_pwm_dc_raw_value < |
| 2932 | L4_MABX_P.PWMADCRngMax_Value); |
| 2933 | |
| 2934 | /* Logic: '<S783>/conjunction' */ |
| 2935 | L4_MABX_B.conjunction_e = (L4_MABX_B.min_relop_c && L4_MABX_B.max_relop_g); |
| 2936 | |
| 2937 | /* UnitDelay: '<S788>/FixPt Unit Delay2' */ |
| 2938 | L4_MABX_B.FixPtUnitDelay2_d = L4_MABX_DW.FixPtUnitDelay2_DSTATE_k; |
| 2939 | |
| 2940 | /* UnitDelay: '<S788>/FixPt Unit Delay1' */ |
| 2941 | L4_MABX_B.Xold_f = L4_MABX_DW.FixPtUnitDelay1_DSTATE_p; |
| 2942 | |
| 2943 | /* Switch: '<S788>/Init' incorporates: |
| 2944 | * Constant: '<S763>/PWMADCRngFaultLimMin' |
| 2945 | */ |
| 2946 | if (L4_MABX_B.FixPtUnitDelay2_d != 0) { |
| 2947 | L4_MABX_B.Init_f = L4_MABX_P.PWMADCRngFaultLimMin_Value; |
| 2948 | } else { |
| 2949 | L4_MABX_B.Init_f = L4_MABX_B.Xold_f; |
| 2950 | } |
| 2951 | |
| 2952 | /* End of Switch: '<S788>/Init' */ |
| 2953 | |
| 2954 | /* Sum: '<S784>/FixPt Sum1' incorporates: |
| 2955 | * Constant: '<S784>/FixPt Constant' |
| 2956 | */ |
| 2957 | L4_MABX_B.FixPtSum1_j = L4_MABX_B.Init_f - L4_MABX_P.FixPtConstant_Value_e; |
| 2958 | |
| 2959 | /* Sum: '<S787>/FixPt Sum1' incorporates: |
| 2960 | * Constant: '<S787>/FixPt Constant' |
| 2961 | */ |
| 2962 | L4_MABX_B.FixPtSum1_m = L4_MABX_B.Init_f + L4_MABX_P.FixPtConstant_Value_p; |
| 2963 | |
| 2964 | /* Outputs for Atomic SubSystem: '<S778>/If_Then_Else3' */ |
| 2965 | L4_MABX_If_Then_Else(L4_MABX_B.conjunction_e, L4_MABX_B.FixPtSum1_j, |
| 2966 | L4_MABX_B.FixPtSum1_m, &L4_MABX_B.If_Then_Else3); |
| 2967 | |
| 2968 | /* End of Outputs for SubSystem: '<S778>/If_Then_Else3' */ |
| 2969 | |
| 2970 | /* RelationalOperator: '<S785>/Relational Operator1' incorporates: |
| 2971 | * Constant: '<S763>/PWMADCRngFaultLimMax' |
| 2972 | */ |
| 2973 | L4_MABX_B.RelationalOperator1_m = (L4_MABX_B.If_Then_Else3.Switch >= |
| 2974 | L4_MABX_P.PWMADCRngFaultLimMax_Value); |
| 2975 | |
| 2976 | /* RelationalOperator: '<S785>/Relational Operator' incorporates: |
| 2977 | * Constant: '<S763>/PWMADCRngFaultLimMin' |
| 2978 | */ |
| 2979 | L4_MABX_B.RelationalOperator_c = (L4_MABX_B.If_Then_Else3.Switch <= |
| 2980 | L4_MABX_P.PWMADCRngFaultLimMin_Value); |
| 2981 | |
| 2982 | /* Outputs for Atomic SubSystem: '<S785>/If_Then_Else1' */ |
| 2983 | |
| 2984 | /* Constant: '<S763>/PWMADCRngFaultLimMin' */ |
| 2985 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_c, |
| 2986 | L4_MABX_P.PWMADCRngFaultLimMin_Value, |
| 2987 | L4_MABX_B.If_Then_Else3.Switch, |
| 2988 | &L4_MABX_B.If_Then_Else1_f); |
| 2989 | |
| 2990 | /* End of Outputs for SubSystem: '<S785>/If_Then_Else1' */ |
| 2991 | |
| 2992 | /* Outputs for Atomic SubSystem: '<S785>/If_Then_Else' */ |
| 2993 | |
| 2994 | /* Constant: '<S763>/PWMADCRngFaultLimMax' */ |
| 2995 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_m, |
| 2996 | L4_MABX_P.PWMADCRngFaultLimMax_Value, |
| 2997 | L4_MABX_B.If_Then_Else1_f.Switch, |
| 2998 | &L4_MABX_B.If_Then_Else_g); |
| 2999 | |
| 3000 | /* End of Outputs for SubSystem: '<S785>/If_Then_Else' */ |
| 3001 | |
| 3002 | /* RelationalOperator: '<S778>/Relational Operator9' incorporates: |
| 3003 | * Constant: '<S763>/PWMADCRngFaultLimMin' |
| 3004 | */ |
| 3005 | L4_MABX_B.F_Fault_Soft_k = (L4_MABX_B.If_Then_Else_g.Switch != |
| 3006 | L4_MABX_P.PWMADCRngFaultLimMin_Value); |
| 3007 | |
| 3008 | /* Logic: '<S763>/Logical Operator2' */ |
| 3009 | L4_MABX_B.LogicalOperator2 = (L4_MABX_B.F_Fault_Soft || |
| 3010 | L4_MABX_B.F_Fault_Soft_k); |
| 3011 | |
| 3012 | /* RelationalOperator: '<S779>/Relational Operator8' incorporates: |
| 3013 | * Constant: '<S763>/PWMAFreqRngFaultLimMax' |
| 3014 | */ |
| 3015 | L4_MABX_B.F_Fault_Hard = (L4_MABX_P.PWMAFreqRngFaultLimMax_Value <= |
| 3016 | L4_MABX_B.If_Then_Else_m.Switch); |
| 3017 | |
| 3018 | /* RelationalOperator: '<S778>/Relational Operator8' incorporates: |
| 3019 | * Constant: '<S763>/PWMADCRngFaultLimMax' |
| 3020 | */ |
| 3021 | L4_MABX_B.F_Fault_Hard_m = (L4_MABX_P.PWMADCRngFaultLimMax_Value <= |
| 3022 | L4_MABX_B.If_Then_Else_g.Switch); |
| 3023 | |
| 3024 | /* Logic: '<S763>/Logical Operator1' */ |
| 3025 | L4_MABX_B.LogicalOperator1 = (L4_MABX_B.F_Fault_Hard || |
| 3026 | L4_MABX_B.F_Fault_Hard_m); |
| 3027 | |
| 3028 | /* Chart: '<S763>/Health State Machine PWM Sensor 1' */ |
| 3029 | /* Gateway: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 1 */ |
| 3030 | /* During: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 1 */ |
| 3031 | if (L4_MABX_DW.is_active_c9_SUB_ECU_L4_MABX_HW == 0U) { |
| 3032 | /* Entry: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 1 */ |
| 3033 | L4_MABX_DW.is_active_c9_SUB_ECU_L4_MABX_HW = 1U; |
| 3034 | |
| 3035 | /* Entry Internal: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 1 */ |
| 3036 | /* Transition: '<S776>:2' */ |
| 3037 | L4_MABX_DW.is_c9_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_NO_FAILURE; |
| 3038 | |
| 3039 | /* Entry 'NO_FAILURE': '<S776>:1' */ |
| 3040 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE; |
| 3041 | } else if (L4_MABX_DW.is_c9_SUB_ECU_L4_MABX_HW_Interf == |
| 3042 | L4_MABX_IN_FAILURE_DETECTED) { |
| 3043 | /* During 'FAILURE_DETECTED': '<S776>:6' */ |
| 3044 | if (L4_MABX_DW.is_FAILURE_DETECTED_d == L4_MABX_IN_ERROR) { |
| 3045 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_ACTIVE; |
| 3046 | |
| 3047 | /* During 'ERROR': '<S776>:8' */ |
| 3048 | if (!L4_MABX_B.LogicalOperator1) { |
| 3049 | /* Transition: '<S776>:17' */ |
| 3050 | L4_MABX_DW.is_FAILURE_DETECTED_d = L4_MABX_IN_PENDING; |
| 3051 | |
| 3052 | /* Entry 'PENDING': '<S776>:7' */ |
| 3053 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING; |
| 3054 | } |
| 3055 | } else { |
| 3056 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING; |
| 3057 | |
| 3058 | /* During 'PENDING': '<S776>:7' */ |
| 3059 | zcEvent = ((!L4_MABX_B.LogicalOperator2) && (!L4_MABX_B.LogicalOperator1)); |
| 3060 | if (zcEvent) { |
| 3061 | /* Transition: '<S776>:9' */ |
| 3062 | L4_MABX_DW.is_FAILURE_DETECTED_d = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 3063 | L4_MABX_DW.is_c9_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_NO_FAILURE; |
| 3064 | |
| 3065 | /* Entry 'NO_FAILURE': '<S776>:1' */ |
| 3066 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE; |
| 3067 | } else { |
| 3068 | if (L4_MABX_B.LogicalOperator1) { |
| 3069 | /* Transition: '<S776>:12' */ |
| 3070 | L4_MABX_DW.is_FAILURE_DETECTED_d = L4_MABX_IN_ERROR; |
| 3071 | |
| 3072 | /* Entry 'ERROR': '<S776>:8' */ |
| 3073 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_ACTIVE; |
| 3074 | } |
| 3075 | } |
| 3076 | } |
| 3077 | } else { |
| 3078 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE; |
| 3079 | |
| 3080 | /* During 'NO_FAILURE': '<S776>:1' */ |
| 3081 | zcEvent = (L4_MABX_B.LogicalOperator2 || L4_MABX_B.LogicalOperator1); |
| 3082 | if (zcEvent) { |
| 3083 | /* Transition: '<S776>:10' */ |
| 3084 | L4_MABX_DW.is_c9_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_FAILURE_DETECTED; |
| 3085 | |
| 3086 | /* Entry 'FAILURE_DETECTED': '<S776>:6' */ |
| 3087 | /* Entry Internal 'FAILURE_DETECTED': '<S776>:6' */ |
| 3088 | /* Transition: '<S776>:11' */ |
| 3089 | L4_MABX_DW.is_FAILURE_DETECTED_d = L4_MABX_IN_PENDING; |
| 3090 | |
| 3091 | /* Entry 'PENDING': '<S776>:7' */ |
| 3092 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING; |
| 3093 | } |
| 3094 | } |
| 3095 | |
| 3096 | /* End of Chart: '<S763>/Health State Machine PWM Sensor 1' */ |
| 3097 | |
| 3098 | /* RelationalOperator: '<S774>/Compare' incorporates: |
| 3099 | * Constant: '<S774>/Constant' |
| 3100 | */ |
| 3101 | L4_MABX_B.Compare_e = (L4_MABX_B.Pedal_1_pwm_health_state == |
| 3102 | L4_MABX_P.CompareToConstant_const_j); |
| 3103 | |
| 3104 | /* S-Function (rti_commonblock): '<S741>/S-Function1' */ |
| 3105 | /* This comment workarounds a code generation problem */ |
| 3106 | |
| 3107 | /* DataTypeConversion: '<S416>/Data Type Conversion3' */ |
| 3108 | L4_MABX_B.Pedal_2_pwm_freq_raw_value = L4_MABX_B.SFunction1_o1_i; |
| 3109 | |
| 3110 | /* RelationalOperator: '<S807>/min_relop' incorporates: |
| 3111 | * Constant: '<S763>/PWMBFreqRngMin1' |
| 3112 | */ |
| 3113 | L4_MABX_B.min_relop_p = (L4_MABX_P.PWMBFreqRngMin1_Value < |
| 3114 | L4_MABX_B.Pedal_2_pwm_freq_raw_value); |
| 3115 | |
| 3116 | /* RelationalOperator: '<S807>/max_relop' incorporates: |
| 3117 | * Constant: '<S763>/PWMBFreqRngMax1' |
| 3118 | */ |
| 3119 | L4_MABX_B.max_relop_n = (L4_MABX_B.Pedal_2_pwm_freq_raw_value < |
| 3120 | L4_MABX_P.PWMBFreqRngMax1_Value); |
| 3121 | |
| 3122 | /* Logic: '<S807>/conjunction' */ |
| 3123 | L4_MABX_B.conjunction_g = (L4_MABX_B.min_relop_p && L4_MABX_B.max_relop_n); |
| 3124 | |
| 3125 | /* UnitDelay: '<S812>/FixPt Unit Delay2' */ |
| 3126 | L4_MABX_B.FixPtUnitDelay2_j = L4_MABX_DW.FixPtUnitDelay2_DSTATE_e; |
| 3127 | |
| 3128 | /* UnitDelay: '<S812>/FixPt Unit Delay1' */ |
| 3129 | L4_MABX_B.Xold_g = L4_MABX_DW.FixPtUnitDelay1_DSTATE_p4; |
| 3130 | |
| 3131 | /* Switch: '<S812>/Init' incorporates: |
| 3132 | * Constant: '<S763>/PWMBFreqRngFaultLimMin1' |
| 3133 | */ |
| 3134 | if (L4_MABX_B.FixPtUnitDelay2_j != 0) { |
| 3135 | L4_MABX_B.Init_m = L4_MABX_P.PWMBFreqRngFaultLimMin1_Value; |
| 3136 | } else { |
| 3137 | L4_MABX_B.Init_m = L4_MABX_B.Xold_g; |
| 3138 | } |
| 3139 | |
| 3140 | /* End of Switch: '<S812>/Init' */ |
| 3141 | |
| 3142 | /* Sum: '<S808>/FixPt Sum1' incorporates: |
| 3143 | * Constant: '<S808>/FixPt Constant' |
| 3144 | */ |
| 3145 | L4_MABX_B.FixPtSum1_a = L4_MABX_B.Init_m - L4_MABX_P.FixPtConstant_Value_a; |
| 3146 | |
| 3147 | /* Sum: '<S811>/FixPt Sum1' incorporates: |
| 3148 | * Constant: '<S811>/FixPt Constant' |
| 3149 | */ |
| 3150 | L4_MABX_B.FixPtSum1_h = L4_MABX_B.Init_m + L4_MABX_P.FixPtConstant_Value_fh; |
| 3151 | |
| 3152 | /* Outputs for Atomic SubSystem: '<S781>/If_Then_Else3' */ |
| 3153 | L4_MABX_If_Then_Else(L4_MABX_B.conjunction_g, L4_MABX_B.FixPtSum1_a, |
| 3154 | L4_MABX_B.FixPtSum1_h, &L4_MABX_B.If_Then_Else3_m); |
| 3155 | |
| 3156 | /* End of Outputs for SubSystem: '<S781>/If_Then_Else3' */ |
| 3157 | |
| 3158 | /* RelationalOperator: '<S809>/Relational Operator1' incorporates: |
| 3159 | * Constant: '<S763>/PWMBFreqRngFaultLimMax1' |
| 3160 | */ |
| 3161 | L4_MABX_B.RelationalOperator1_c = (L4_MABX_B.If_Then_Else3_m.Switch >= |
| 3162 | L4_MABX_P.PWMBFreqRngFaultLimMax1_Value); |
| 3163 | |
| 3164 | /* RelationalOperator: '<S809>/Relational Operator' incorporates: |
| 3165 | * Constant: '<S763>/PWMBFreqRngFaultLimMin1' |
| 3166 | */ |
| 3167 | L4_MABX_B.RelationalOperator_m = (L4_MABX_B.If_Then_Else3_m.Switch <= |
| 3168 | L4_MABX_P.PWMBFreqRngFaultLimMin1_Value); |
| 3169 | |
| 3170 | /* Outputs for Atomic SubSystem: '<S809>/If_Then_Else1' */ |
| 3171 | |
| 3172 | /* Constant: '<S763>/PWMBFreqRngFaultLimMin1' */ |
| 3173 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_m, |
| 3174 | L4_MABX_P.PWMBFreqRngFaultLimMin1_Value, |
| 3175 | L4_MABX_B.If_Then_Else3_m.Switch, |
| 3176 | &L4_MABX_B.If_Then_Else1_g); |
| 3177 | |
| 3178 | /* End of Outputs for SubSystem: '<S809>/If_Then_Else1' */ |
| 3179 | |
| 3180 | /* Outputs for Atomic SubSystem: '<S809>/If_Then_Else' */ |
| 3181 | |
| 3182 | /* Constant: '<S763>/PWMBFreqRngFaultLimMax1' */ |
| 3183 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_c, |
| 3184 | L4_MABX_P.PWMBFreqRngFaultLimMax1_Value, |
| 3185 | L4_MABX_B.If_Then_Else1_g.Switch, |
| 3186 | &L4_MABX_B.If_Then_Else_b); |
| 3187 | |
| 3188 | /* End of Outputs for SubSystem: '<S809>/If_Then_Else' */ |
| 3189 | |
| 3190 | /* RelationalOperator: '<S781>/Relational Operator9' incorporates: |
| 3191 | * Constant: '<S763>/PWMBFreqRngFaultLimMin1' |
| 3192 | */ |
| 3193 | L4_MABX_B.F_Fault_Soft_b = (L4_MABX_B.If_Then_Else_b.Switch != |
| 3194 | L4_MABX_P.PWMBFreqRngFaultLimMin1_Value); |
| 3195 | |
| 3196 | /* Gain: '<S416>/Gain1' */ |
| 3197 | L4_MABX_B.Gain1 = L4_MABX_P.Gain1_Gain_d * L4_MABX_B.SFunction1_o2_k; |
| 3198 | |
| 3199 | /* DataTypeConversion: '<S416>/Data Type Conversion1' */ |
| 3200 | L4_MABX_B.Pedal_2_pwm_dc_raw_value = L4_MABX_B.Gain1; |
| 3201 | |
| 3202 | /* RelationalOperator: '<S799>/min_relop' incorporates: |
| 3203 | * Constant: '<S763>/PWMBDCRngMin1' |
| 3204 | */ |
| 3205 | L4_MABX_B.min_relop_e = (L4_MABX_P.PWMBDCRngMin1_Value < |
| 3206 | L4_MABX_B.Pedal_2_pwm_dc_raw_value); |
| 3207 | |
| 3208 | /* RelationalOperator: '<S799>/max_relop' incorporates: |
| 3209 | * Constant: '<S763>/PWMBDCRngMax1' |
| 3210 | */ |
| 3211 | L4_MABX_B.max_relop_f = (L4_MABX_B.Pedal_2_pwm_dc_raw_value < |
| 3212 | L4_MABX_P.PWMBDCRngMax1_Value); |
| 3213 | |
| 3214 | /* Logic: '<S799>/conjunction' */ |
| 3215 | L4_MABX_B.conjunction_c = (L4_MABX_B.min_relop_e && L4_MABX_B.max_relop_f); |
| 3216 | |
| 3217 | /* UnitDelay: '<S804>/FixPt Unit Delay2' */ |
| 3218 | L4_MABX_B.FixPtUnitDelay2_g = L4_MABX_DW.FixPtUnitDelay2_DSTATE_g; |
| 3219 | |
| 3220 | /* UnitDelay: '<S804>/FixPt Unit Delay1' */ |
| 3221 | L4_MABX_B.Xold_b = L4_MABX_DW.FixPtUnitDelay1_DSTATE_pb; |
| 3222 | |
| 3223 | /* Switch: '<S804>/Init' incorporates: |
| 3224 | * Constant: '<S763>/PWMBDCRngFaultLimMin1' |
| 3225 | */ |
| 3226 | if (L4_MABX_B.FixPtUnitDelay2_g != 0) { |
| 3227 | L4_MABX_B.Init_l = L4_MABX_P.PWMBDCRngFaultLimMin1_Value; |
| 3228 | } else { |
| 3229 | L4_MABX_B.Init_l = L4_MABX_B.Xold_b; |
| 3230 | } |
| 3231 | |
| 3232 | /* End of Switch: '<S804>/Init' */ |
| 3233 | |
| 3234 | /* Sum: '<S800>/FixPt Sum1' incorporates: |
| 3235 | * Constant: '<S800>/FixPt Constant' |
| 3236 | */ |
| 3237 | L4_MABX_B.FixPtSum1_k = L4_MABX_B.Init_l - L4_MABX_P.FixPtConstant_Value_b; |
| 3238 | |
| 3239 | /* Sum: '<S803>/FixPt Sum1' incorporates: |
| 3240 | * Constant: '<S803>/FixPt Constant' |
| 3241 | */ |
| 3242 | L4_MABX_B.FixPtSum1_n = L4_MABX_B.Init_l + L4_MABX_P.FixPtConstant_Value_o; |
| 3243 | |
| 3244 | /* Outputs for Atomic SubSystem: '<S780>/If_Then_Else3' */ |
| 3245 | L4_MABX_If_Then_Else(L4_MABX_B.conjunction_c, L4_MABX_B.FixPtSum1_k, |
| 3246 | L4_MABX_B.FixPtSum1_n, &L4_MABX_B.If_Then_Else3_g); |
| 3247 | |
| 3248 | /* End of Outputs for SubSystem: '<S780>/If_Then_Else3' */ |
| 3249 | |
| 3250 | /* RelationalOperator: '<S801>/Relational Operator1' incorporates: |
| 3251 | * Constant: '<S763>/PWMBDCRngFaultLimMax1' |
| 3252 | */ |
| 3253 | L4_MABX_B.RelationalOperator1_j = (L4_MABX_B.If_Then_Else3_g.Switch >= |
| 3254 | L4_MABX_P.PWMBDCRngFaultLimMax1_Value); |
| 3255 | |
| 3256 | /* RelationalOperator: '<S801>/Relational Operator' incorporates: |
| 3257 | * Constant: '<S763>/PWMBDCRngFaultLimMin1' |
| 3258 | */ |
| 3259 | L4_MABX_B.RelationalOperator_a = (L4_MABX_B.If_Then_Else3_g.Switch <= |
| 3260 | L4_MABX_P.PWMBDCRngFaultLimMin1_Value); |
| 3261 | |
| 3262 | /* Outputs for Atomic SubSystem: '<S801>/If_Then_Else1' */ |
| 3263 | |
| 3264 | /* Constant: '<S763>/PWMBDCRngFaultLimMin1' */ |
| 3265 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_a, |
| 3266 | L4_MABX_P.PWMBDCRngFaultLimMin1_Value, |
| 3267 | L4_MABX_B.If_Then_Else3_g.Switch, |
| 3268 | &L4_MABX_B.If_Then_Else1_fs); |
| 3269 | |
| 3270 | /* End of Outputs for SubSystem: '<S801>/If_Then_Else1' */ |
| 3271 | |
| 3272 | /* Outputs for Atomic SubSystem: '<S801>/If_Then_Else' */ |
| 3273 | |
| 3274 | /* Constant: '<S763>/PWMBDCRngFaultLimMax1' */ |
| 3275 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_j, |
| 3276 | L4_MABX_P.PWMBDCRngFaultLimMax1_Value, |
| 3277 | L4_MABX_B.If_Then_Else1_fs.Switch, |
| 3278 | &L4_MABX_B.If_Then_Else_a); |
| 3279 | |
| 3280 | /* End of Outputs for SubSystem: '<S801>/If_Then_Else' */ |
| 3281 | |
| 3282 | /* RelationalOperator: '<S780>/Relational Operator9' incorporates: |
| 3283 | * Constant: '<S763>/PWMBDCRngFaultLimMin1' |
| 3284 | */ |
| 3285 | L4_MABX_B.F_Fault_Soft_f = (L4_MABX_B.If_Then_Else_a.Switch != |
| 3286 | L4_MABX_P.PWMBDCRngFaultLimMin1_Value); |
| 3287 | |
| 3288 | /* Logic: '<S763>/Logical Operator4' */ |
| 3289 | L4_MABX_B.LogicalOperator4 = (L4_MABX_B.F_Fault_Soft_b || |
| 3290 | L4_MABX_B.F_Fault_Soft_f); |
| 3291 | |
| 3292 | /* RelationalOperator: '<S781>/Relational Operator8' incorporates: |
| 3293 | * Constant: '<S763>/PWMBFreqRngFaultLimMax1' |
| 3294 | */ |
| 3295 | L4_MABX_B.F_Fault_Hard_j = (L4_MABX_P.PWMBFreqRngFaultLimMax1_Value <= |
| 3296 | L4_MABX_B.If_Then_Else_b.Switch); |
| 3297 | |
| 3298 | /* RelationalOperator: '<S780>/Relational Operator8' incorporates: |
| 3299 | * Constant: '<S763>/PWMBDCRngFaultLimMax1' |
| 3300 | */ |
| 3301 | L4_MABX_B.F_Fault_Hard_o = (L4_MABX_P.PWMBDCRngFaultLimMax1_Value <= |
| 3302 | L4_MABX_B.If_Then_Else_a.Switch); |
| 3303 | |
| 3304 | /* Logic: '<S763>/Logical Operator3' */ |
| 3305 | L4_MABX_B.LogicalOperator3 = (L4_MABX_B.F_Fault_Hard_j || |
| 3306 | L4_MABX_B.F_Fault_Hard_o); |
| 3307 | |
| 3308 | /* Chart: '<S763>/Health State Machine PWM Sensor 2' */ |
| 3309 | /* Gateway: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 2 */ |
| 3310 | /* During: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 2 */ |
| 3311 | if (L4_MABX_DW.is_active_c10_SUB_ECU_L4_MABX_H == 0U) { |
| 3312 | /* Entry: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 2 */ |
| 3313 | L4_MABX_DW.is_active_c10_SUB_ECU_L4_MABX_H = 1U; |
| 3314 | |
| 3315 | /* Entry Internal: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 2 */ |
| 3316 | /* Transition: '<S777>:2' */ |
| 3317 | L4_MABX_DW.is_c10_SUB_ECU_L4_MABX_HW_Inter = L4_MABX_IN_NO_FAILURE; |
| 3318 | |
| 3319 | /* Entry 'NO_FAILURE': '<S777>:1' */ |
| 3320 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE; |
| 3321 | } else if (L4_MABX_DW.is_c10_SUB_ECU_L4_MABX_HW_Inter == |
| 3322 | L4_MABX_IN_FAILURE_DETECTED) { |
| 3323 | /* During 'FAILURE_DETECTED': '<S777>:6' */ |
| 3324 | if (L4_MABX_DW.is_FAILURE_DETECTED == L4_MABX_IN_ERROR) { |
| 3325 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_ACTIVE; |
| 3326 | |
| 3327 | /* During 'ERROR': '<S777>:8' */ |
| 3328 | if (!L4_MABX_B.LogicalOperator3) { |
| 3329 | /* Transition: '<S777>:20' */ |
| 3330 | L4_MABX_DW.is_FAILURE_DETECTED = L4_MABX_IN_PENDING; |
| 3331 | |
| 3332 | /* Entry 'PENDING': '<S777>:7' */ |
| 3333 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING; |
| 3334 | } |
| 3335 | } else { |
| 3336 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING; |
| 3337 | |
| 3338 | /* During 'PENDING': '<S777>:7' */ |
| 3339 | zcEvent = ((!L4_MABX_B.LogicalOperator4) && (!L4_MABX_B.LogicalOperator3)); |
| 3340 | if (zcEvent) { |
| 3341 | /* Transition: '<S777>:9' */ |
| 3342 | L4_MABX_DW.is_FAILURE_DETECTED = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 3343 | L4_MABX_DW.is_c10_SUB_ECU_L4_MABX_HW_Inter = L4_MABX_IN_NO_FAILURE; |
| 3344 | |
| 3345 | /* Entry 'NO_FAILURE': '<S777>:1' */ |
| 3346 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE; |
| 3347 | } else { |
| 3348 | if (L4_MABX_B.LogicalOperator3) { |
| 3349 | /* Transition: '<S777>:12' */ |
| 3350 | L4_MABX_DW.is_FAILURE_DETECTED = L4_MABX_IN_ERROR; |
| 3351 | |
| 3352 | /* Entry 'ERROR': '<S777>:8' */ |
| 3353 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_ACTIVE; |
| 3354 | } |
| 3355 | } |
| 3356 | } |
| 3357 | } else { |
| 3358 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE; |
| 3359 | |
| 3360 | /* During 'NO_FAILURE': '<S777>:1' */ |
| 3361 | zcEvent = (L4_MABX_B.LogicalOperator4 || L4_MABX_B.LogicalOperator3); |
| 3362 | if (zcEvent) { |
| 3363 | /* Transition: '<S777>:10' */ |
| 3364 | L4_MABX_DW.is_c10_SUB_ECU_L4_MABX_HW_Inter = L4_MABX_IN_FAILURE_DETECTED; |
| 3365 | |
| 3366 | /* Entry 'FAILURE_DETECTED': '<S777>:6' */ |
| 3367 | /* Entry Internal 'FAILURE_DETECTED': '<S777>:6' */ |
| 3368 | /* Transition: '<S777>:11' */ |
| 3369 | L4_MABX_DW.is_FAILURE_DETECTED = L4_MABX_IN_PENDING; |
| 3370 | |
| 3371 | /* Entry 'PENDING': '<S777>:7' */ |
| 3372 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING; |
| 3373 | } |
| 3374 | } |
| 3375 | |
| 3376 | /* End of Chart: '<S763>/Health State Machine PWM Sensor 2' */ |
| 3377 | |
| 3378 | /* RelationalOperator: '<S775>/Compare' incorporates: |
| 3379 | * Constant: '<S775>/Constant' |
| 3380 | */ |
| 3381 | L4_MABX_B.Compare_c = (L4_MABX_B.Pedal_2_pwm_health_state == |
| 3382 | L4_MABX_P.CompareToConstant2_const_n); |
| 3383 | |
| 3384 | /* Logic: '<S763>/Logical Operator5' */ |
| 3385 | L4_MABX_B.F_Pedal_pwm_sens_total_failure = (L4_MABX_B.Compare_e && |
| 3386 | L4_MABX_B.Compare_c); |
| 3387 | |
| 3388 | /* UnitDelay: '<S766>/Unit_Delay' */ |
| 3389 | L4_MABX_B.Unit_Delay_jw = L4_MABX_DW.Unit_Delay_DSTATE_mb; |
| 3390 | |
| 3391 | /* UnitDelay: '<S833>/Unit_Delay1' */ |
| 3392 | L4_MABX_B.Unit_Delay1 = L4_MABX_DW.Unit_Delay1_DSTATE; |
| 3393 | |
| 3394 | /* Logic: '<S833>/Logical Operator' */ |
| 3395 | L4_MABX_B.LogicalOperator_p = (L4_MABX_B.Unit_Delay_jw || |
| 3396 | L4_MABX_B.Unit_Delay1); |
| 3397 | |
| 3398 | /* MinMax: '<S833>/MinMax1' incorporates: |
| 3399 | * Constant: '<S766>/PEDAL_PWM_SENSOR_DATA_APV.T1_CONST' |
| 3400 | * Constant: '<S766>/dT' |
| 3401 | */ |
| 3402 | DeltaTime = L4_MABX_P.dT_Value; |
| 3403 | PositionFinalLimited = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVT1_CON; |
| 3404 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 3405 | PositionFinalLimited = DeltaTime; |
| 3406 | } |
| 3407 | |
| 3408 | L4_MABX_B.MinMax1 = PositionFinalLimited; |
| 3409 | |
| 3410 | /* End of MinMax: '<S833>/MinMax1' */ |
| 3411 | |
| 3412 | /* Saturate: '<S833>/Saturation' */ |
| 3413 | DeltaTime = L4_MABX_B.MinMax1; |
| 3414 | Time56 = L4_MABX_P.Saturation_LowerSat_j; |
| 3415 | PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_k; |
| 3416 | if (DeltaTime > PositionFinalLimited) { |
| 3417 | L4_MABX_B.Saturation = PositionFinalLimited; |
| 3418 | } else if (DeltaTime < Time56) { |
| 3419 | L4_MABX_B.Saturation = Time56; |
| 3420 | } else { |
| 3421 | L4_MABX_B.Saturation = DeltaTime; |
| 3422 | } |
| 3423 | |
| 3424 | /* End of Saturate: '<S833>/Saturation' */ |
| 3425 | |
| 3426 | /* Product: '<S833>/Divide' incorporates: |
| 3427 | * Constant: '<S766>/dT' |
| 3428 | */ |
| 3429 | L4_MABX_B.Divide = L4_MABX_P.dT_Value / L4_MABX_B.Saturation; |
| 3430 | |
| 3431 | /* Product: '<S833>/Product2' */ |
| 3432 | L4_MABX_B.Product2 = L4_MABX_B.Pedal_1_pwm_dc_raw_value * L4_MABX_B.Divide; |
| 3433 | |
| 3434 | /* Sum: '<S833>/Subtract1' incorporates: |
| 3435 | * Constant: '<S833>/Constant1' |
| 3436 | */ |
| 3437 | L4_MABX_B.Subtract1 = L4_MABX_P.Constant1_Value_nn - L4_MABX_B.Divide; |
| 3438 | |
| 3439 | /* UnitDelay: '<S833>/Unit_Delay2' */ |
| 3440 | L4_MABX_B.Unit_Delay2 = L4_MABX_DW.Unit_Delay2_DSTATE; |
| 3441 | |
| 3442 | /* Product: '<S833>/Product1' */ |
| 3443 | L4_MABX_B.Product1 = L4_MABX_B.Subtract1 * L4_MABX_B.Unit_Delay2; |
| 3444 | |
| 3445 | /* Sum: '<S833>/Add1' */ |
| 3446 | L4_MABX_B.Add1 = L4_MABX_B.Product2 + L4_MABX_B.Product1; |
| 3447 | |
| 3448 | /* Outputs for Atomic SubSystem: '<S833>/If_Then_Else' */ |
| 3449 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_p, |
| 3450 | L4_MABX_B.Pedal_1_pwm_dc_raw_value, L4_MABX_B.Add1, |
| 3451 | &L4_MABX_B.If_Then_Else_e); |
| 3452 | |
| 3453 | /* End of Outputs for SubSystem: '<S833>/If_Then_Else' */ |
| 3454 | |
| 3455 | /* Lookup_n-D: '<S766>/PEDAL_PWM_ANGLE_SENS_1_MPV' */ |
| 3456 | L4_MABX_B.Pedal_1_pwm_undefault = look1_binlcapw |
| 3457 | (L4_MABX_B.If_Then_Else_e.Switch, L4_MABX_P.PEDAL_PWM_ANGLE_SENS_1_MPV_bp01, |
| 3458 | L4_MABX_P.PEDAL_PWM_ANGLE_SENS_1_MPV_tabl, 7U); |
| 3459 | |
| 3460 | /* UnitDelay: '<S766>/Unit_Delay1' */ |
| 3461 | L4_MABX_B.Unit_Delay1_m = L4_MABX_DW.Unit_Delay1_DSTATE_a; |
| 3462 | |
| 3463 | /* UnitDelay: '<S834>/Unit_Delay1' */ |
| 3464 | L4_MABX_B.Unit_Delay1_h = L4_MABX_DW.Unit_Delay1_DSTATE_l; |
| 3465 | |
| 3466 | /* Logic: '<S834>/Logical Operator' */ |
| 3467 | L4_MABX_B.LogicalOperator_c = (L4_MABX_B.Unit_Delay1_m || |
| 3468 | L4_MABX_B.Unit_Delay1_h); |
| 3469 | |
| 3470 | /* MinMax: '<S834>/MinMax1' incorporates: |
| 3471 | * Constant: '<S766>/PEDAL_PWM_SENSOR_DATA_APV.T2_CONST' |
| 3472 | * Constant: '<S766>/dT1' |
| 3473 | */ |
| 3474 | DeltaTime = L4_MABX_P.dT1_Value; |
| 3475 | PositionFinalLimited = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVT2_CON; |
| 3476 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 3477 | PositionFinalLimited = DeltaTime; |
| 3478 | } |
| 3479 | |
| 3480 | L4_MABX_B.MinMax1_c = PositionFinalLimited; |
| 3481 | |
| 3482 | /* End of MinMax: '<S834>/MinMax1' */ |
| 3483 | |
| 3484 | /* Saturate: '<S834>/Saturation' */ |
| 3485 | DeltaTime = L4_MABX_B.MinMax1_c; |
| 3486 | Time56 = L4_MABX_P.Saturation_LowerSat_n; |
| 3487 | PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_gp; |
| 3488 | if (DeltaTime > PositionFinalLimited) { |
| 3489 | L4_MABX_B.Saturation_b = PositionFinalLimited; |
| 3490 | } else if (DeltaTime < Time56) { |
| 3491 | L4_MABX_B.Saturation_b = Time56; |
| 3492 | } else { |
| 3493 | L4_MABX_B.Saturation_b = DeltaTime; |
| 3494 | } |
| 3495 | |
| 3496 | /* End of Saturate: '<S834>/Saturation' */ |
| 3497 | |
| 3498 | /* Product: '<S834>/Divide' incorporates: |
| 3499 | * Constant: '<S766>/dT1' |
| 3500 | */ |
| 3501 | L4_MABX_B.Divide_g = L4_MABX_P.dT1_Value / L4_MABX_B.Saturation_b; |
| 3502 | |
| 3503 | /* Product: '<S834>/Product2' */ |
| 3504 | L4_MABX_B.Product2_d = L4_MABX_B.Pedal_2_pwm_freq_raw_value * |
| 3505 | L4_MABX_B.Divide_g; |
| 3506 | |
| 3507 | /* Sum: '<S834>/Subtract1' incorporates: |
| 3508 | * Constant: '<S834>/Constant1' |
| 3509 | */ |
| 3510 | L4_MABX_B.Subtract1_j = L4_MABX_P.Constant1_Value_pj - L4_MABX_B.Divide_g; |
| 3511 | |
| 3512 | /* UnitDelay: '<S834>/Unit_Delay2' */ |
| 3513 | L4_MABX_B.Unit_Delay2_n = L4_MABX_DW.Unit_Delay2_DSTATE_m; |
| 3514 | |
| 3515 | /* Product: '<S834>/Product1' */ |
| 3516 | L4_MABX_B.Product1_h = L4_MABX_B.Subtract1_j * L4_MABX_B.Unit_Delay2_n; |
| 3517 | |
| 3518 | /* Sum: '<S834>/Add1' */ |
| 3519 | L4_MABX_B.Add1_c = L4_MABX_B.Product2_d + L4_MABX_B.Product1_h; |
| 3520 | |
| 3521 | /* Outputs for Atomic SubSystem: '<S834>/If_Then_Else' */ |
| 3522 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_c, |
| 3523 | L4_MABX_B.Pedal_2_pwm_freq_raw_value, L4_MABX_B.Add1_c, |
| 3524 | &L4_MABX_B.If_Then_Else_ex); |
| 3525 | |
| 3526 | /* End of Outputs for SubSystem: '<S834>/If_Then_Else' */ |
| 3527 | |
| 3528 | /* Lookup_n-D: '<S766>/PEDAL_PWM_ANGLE_SENS_2_MPV' */ |
| 3529 | L4_MABX_B.Pedal_2_pwm_undefault = look1_binlcapw |
| 3530 | (L4_MABX_B.If_Then_Else_ex.Switch, L4_MABX_P.PEDAL_PWM_ANGLE_SENS_2_MPV_bp01, |
| 3531 | L4_MABX_P.PEDAL_PWM_ANGLE_SENS_2_MPV_tabl, 7U); |
| 3532 | |
| 3533 | /* Sum: '<S768>/Subtract' */ |
| 3534 | L4_MABX_B.Subtract = L4_MABX_B.Pedal_1_pwm_undefault - |
| 3535 | L4_MABX_B.Pedal_2_pwm_undefault; |
| 3536 | |
| 3537 | /* Abs: '<S768>/Abs' */ |
| 3538 | L4_MABX_B.Abs = fabs(L4_MABX_B.Subtract); |
| 3539 | |
| 3540 | /* RelationalOperator: '<S770>/Compare' incorporates: |
| 3541 | * Constant: '<S770>/Constant' |
| 3542 | */ |
| 3543 | L4_MABX_B.Compare_l = (L4_MABX_B.Pedal_1_pwm_health_state == |
| 3544 | L4_MABX_P.CompareToConstant3_const_l); |
| 3545 | |
| 3546 | /* RelationalOperator: '<S826>/Compare' incorporates: |
| 3547 | * Constant: '<S826>/Constant' |
| 3548 | */ |
| 3549 | L4_MABX_B.Compare_k = (L4_MABX_B.Pedal_2_pwm_health_state == |
| 3550 | L4_MABX_P.CompareToConstant5_const); |
| 3551 | |
| 3552 | /* Logic: '<S764>/Logical Operator7' */ |
| 3553 | L4_MABX_B.LogicalOperator7 = !L4_MABX_B.Compare_k; |
| 3554 | |
| 3555 | /* RelationalOperator: '<S825>/Compare' incorporates: |
| 3556 | * Constant: '<S825>/Constant' |
| 3557 | */ |
| 3558 | L4_MABX_B.Compare_d = (L4_MABX_B.Pedal_2_pwm_health_state == |
| 3559 | L4_MABX_P.CompareToConstant4_const); |
| 3560 | |
| 3561 | /* Logic: '<S764>/Logical Operator8' */ |
| 3562 | L4_MABX_B.LogicalOperator8 = !L4_MABX_B.Compare_d; |
| 3563 | |
| 3564 | /* UnitDelay: '<S832>/FixPt Unit Delay2' */ |
| 3565 | L4_MABX_B.FixPtUnitDelay2_c = L4_MABX_DW.FixPtUnitDelay2_DSTATE_o; |
| 3566 | |
| 3567 | /* UnitDelay: '<S832>/FixPt Unit Delay1' */ |
| 3568 | L4_MABX_B.Xold_k = L4_MABX_DW.FixPtUnitDelay1_DSTATE_g; |
| 3569 | |
| 3570 | /* Switch: '<S832>/Init' incorporates: |
| 3571 | * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' |
| 3572 | */ |
| 3573 | if (L4_MABX_B.FixPtUnitDelay2_c != 0) { |
| 3574 | L4_MABX_B.Init_e = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL; |
| 3575 | } else { |
| 3576 | L4_MABX_B.Init_e = L4_MABX_B.Xold_k; |
| 3577 | } |
| 3578 | |
| 3579 | /* End of Switch: '<S832>/Init' */ |
| 3580 | |
| 3581 | /* Outputs for Atomic SubSystem: '<S764>/If_Then_Else3' */ |
| 3582 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator8, |
| 3583 | L4_MABX_B.Pedal_2_pwm_undefault, L4_MABX_B.Init_e, |
| 3584 | &L4_MABX_B.If_Then_Else3_l); |
| 3585 | |
| 3586 | /* End of Outputs for SubSystem: '<S764>/If_Then_Else3' */ |
| 3587 | |
| 3588 | /* Outputs for Atomic SubSystem: '<S764>/If_Then_Else2' */ |
| 3589 | |
| 3590 | /* Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' */ |
| 3591 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator7, |
| 3592 | L4_MABX_B.If_Then_Else3_l.Switch, |
| 3593 | L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL, |
| 3594 | &L4_MABX_B.If_Then_Else2_n); |
| 3595 | |
| 3596 | /* End of Outputs for SubSystem: '<S764>/If_Then_Else2' */ |
| 3597 | |
| 3598 | /* RelationalOperator: '<S824>/Compare' incorporates: |
| 3599 | * Constant: '<S824>/Constant' |
| 3600 | */ |
| 3601 | L4_MABX_B.Compare_j = (L4_MABX_B.Pedal_1_pwm_health_state == |
| 3602 | L4_MABX_P.CompareToConstant3_const_a); |
| 3603 | |
| 3604 | /* Logic: '<S764>/Logical Operator5' */ |
| 3605 | L4_MABX_B.LogicalOperator5 = !L4_MABX_B.Compare_j; |
| 3606 | |
| 3607 | /* RelationalOperator: '<S823>/Compare' incorporates: |
| 3608 | * Constant: '<S823>/Constant' |
| 3609 | */ |
| 3610 | L4_MABX_B.Compare_b = (L4_MABX_B.Pedal_1_pwm_health_state == |
| 3611 | L4_MABX_P.CompareToConstant1_const_a); |
| 3612 | |
| 3613 | /* Logic: '<S764>/Logical Operator6' */ |
| 3614 | L4_MABX_B.LogicalOperator6 = !L4_MABX_B.Compare_b; |
| 3615 | |
| 3616 | /* UnitDelay: '<S831>/FixPt Unit Delay2' */ |
| 3617 | L4_MABX_B.FixPtUnitDelay2_i = L4_MABX_DW.FixPtUnitDelay2_DSTATE_h; |
| 3618 | |
| 3619 | /* UnitDelay: '<S831>/FixPt Unit Delay1' */ |
| 3620 | L4_MABX_B.Xold_n = L4_MABX_DW.FixPtUnitDelay1_DSTATE_p2; |
| 3621 | |
| 3622 | /* Switch: '<S831>/Init' incorporates: |
| 3623 | * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' |
| 3624 | */ |
| 3625 | if (L4_MABX_B.FixPtUnitDelay2_i != 0) { |
| 3626 | L4_MABX_B.Init_j = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL; |
| 3627 | } else { |
| 3628 | L4_MABX_B.Init_j = L4_MABX_B.Xold_n; |
| 3629 | } |
| 3630 | |
| 3631 | /* End of Switch: '<S831>/Init' */ |
| 3632 | |
| 3633 | /* Outputs for Atomic SubSystem: '<S764>/If_Then_Else1' */ |
| 3634 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator6, |
| 3635 | L4_MABX_B.Pedal_1_pwm_undefault, L4_MABX_B.Init_j, |
| 3636 | &L4_MABX_B.If_Then_Else1_kz); |
| 3637 | |
| 3638 | /* End of Outputs for SubSystem: '<S764>/If_Then_Else1' */ |
| 3639 | |
| 3640 | /* Outputs for Atomic SubSystem: '<S764>/If_Then_Else' */ |
| 3641 | |
| 3642 | /* Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' */ |
| 3643 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator5, |
| 3644 | L4_MABX_B.If_Then_Else1_kz.Switch, |
| 3645 | L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL, |
| 3646 | &L4_MABX_B.If_Then_Else_p); |
| 3647 | |
| 3648 | /* End of Outputs for SubSystem: '<S764>/If_Then_Else' */ |
| 3649 | |
| 3650 | /* Outputs for Atomic SubSystem: '<S762>/If_Then_Else1' */ |
| 3651 | L4_MABX_If_Then_Else(L4_MABX_B.Compare_l, L4_MABX_B.If_Then_Else2_n.Switch, |
| 3652 | L4_MABX_B.If_Then_Else_p.Switch, &L4_MABX_B.If_Then_Else1); |
| 3653 | |
| 3654 | /* End of Outputs for SubSystem: '<S762>/If_Then_Else1' */ |
| 3655 | |
| 3656 | /* RelationalOperator: '<S769>/Compare' incorporates: |
| 3657 | * Constant: '<S769>/Constant' |
| 3658 | */ |
| 3659 | L4_MABX_B.Compare_jw = (L4_MABX_B.Pedal_2_pwm_health_state == |
| 3660 | L4_MABX_P.CompareToConstant1_const_c); |
| 3661 | |
| 3662 | /* Outputs for Atomic SubSystem: '<S762>/If_Then_Else2' */ |
| 3663 | L4_MABX_If_Then_Else(L4_MABX_B.Compare_jw, L4_MABX_B.If_Then_Else_p.Switch, |
| 3664 | L4_MABX_B.If_Then_Else2_n.Switch, |
| 3665 | &L4_MABX_B.If_Then_Else2); |
| 3666 | |
| 3667 | /* End of Outputs for SubSystem: '<S762>/If_Then_Else2' */ |
| 3668 | |
| 3669 | /* MinMax: '<S762>/MinMax' */ |
| 3670 | DeltaTime = L4_MABX_B.If_Then_Else1.Switch; |
| 3671 | PositionFinalLimited = L4_MABX_B.If_Then_Else2.Switch; |
| 3672 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 3673 | PositionFinalLimited = DeltaTime; |
| 3674 | } |
| 3675 | |
| 3676 | L4_MABX_B.MinMax = PositionFinalLimited; |
| 3677 | |
| 3678 | /* End of MinMax: '<S762>/MinMax' */ |
| 3679 | |
| 3680 | /* Outputs for Atomic SubSystem: '<S762>/If_Then_Else' */ |
| 3681 | |
| 3682 | /* Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' */ |
| 3683 | L4_MABX_If_Then_Else(L4_MABX_B.F_Pedal_pwm_sens_total_failure, |
| 3684 | L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL, |
| 3685 | L4_MABX_B.MinMax, &L4_MABX_B.If_Then_Else_k); |
| 3686 | |
| 3687 | /* End of Outputs for SubSystem: '<S762>/If_Then_Else' */ |
| 3688 | |
| 3689 | /* Lookup_n-D: '<S768>/PEDAL_PWM_ANGLE_DEV_MPV' */ |
| 3690 | L4_MABX_B.PEDAL_PWM_ANGLE_DEV_MPV = look1_binlcapw |
| 3691 | (L4_MABX_B.If_Then_Else_k.Switch, L4_MABX_P.PEDAL_PWM_ANGLE_DEV_MPV_bp01Dat, |
| 3692 | L4_MABX_P.PEDAL_PWM_ANGLE_DEV_MPV_tableDa, 7U); |
| 3693 | |
| 3694 | /* RelationalOperator: '<S768>/Relational Operator' */ |
| 3695 | L4_MABX_B.F_Pedal_pwm_sync_fault = (L4_MABX_B.Abs > |
| 3696 | L4_MABX_B.PEDAL_PWM_ANGLE_DEV_MPV); |
| 3697 | |
| 3698 | /* DataTypeConversion: '<S763>/Data Type Conversion2' */ |
| 3699 | L4_MABX_B.DataTypeConversion2 = L4_MABX_B.F_Pedal_pwm_sync_fault; |
| 3700 | |
| 3701 | /* RelationalOperator: '<S815>/min_relop' incorporates: |
| 3702 | * Constant: '<S763>/PWMSynchRngMin' |
| 3703 | */ |
| 3704 | L4_MABX_B.min_relop_o = (L4_MABX_P.PWMSynchRngMin_Value < |
| 3705 | L4_MABX_B.DataTypeConversion2); |
| 3706 | |
| 3707 | /* RelationalOperator: '<S815>/max_relop' incorporates: |
| 3708 | * Constant: '<S763>/PWMSynchRngMax' |
| 3709 | */ |
| 3710 | L4_MABX_B.max_relop_l = (L4_MABX_B.DataTypeConversion2 < |
| 3711 | L4_MABX_P.PWMSynchRngMax_Value); |
| 3712 | |
| 3713 | /* Logic: '<S815>/conjunction' */ |
| 3714 | L4_MABX_B.conjunction_i = (L4_MABX_B.min_relop_o && L4_MABX_B.max_relop_l); |
| 3715 | |
| 3716 | /* UnitDelay: '<S820>/FixPt Unit Delay2' */ |
| 3717 | L4_MABX_B.FixPtUnitDelay2_p = L4_MABX_DW.FixPtUnitDelay2_DSTATE_eo; |
| 3718 | |
| 3719 | /* UnitDelay: '<S820>/FixPt Unit Delay1' */ |
| 3720 | L4_MABX_B.Xold_fx = L4_MABX_DW.FixPtUnitDelay1_DSTATE_h; |
| 3721 | |
| 3722 | /* Switch: '<S820>/Init' incorporates: |
| 3723 | * Constant: '<S763>/PWMSynchFaultLimMin' |
| 3724 | */ |
| 3725 | if (L4_MABX_B.FixPtUnitDelay2_p != 0) { |
| 3726 | L4_MABX_B.Init_d = L4_MABX_P.PWMSynchFaultLimMin_Value; |
| 3727 | } else { |
| 3728 | L4_MABX_B.Init_d = L4_MABX_B.Xold_fx; |
| 3729 | } |
| 3730 | |
| 3731 | /* End of Switch: '<S820>/Init' */ |
| 3732 | |
| 3733 | /* Sum: '<S816>/FixPt Sum1' incorporates: |
| 3734 | * Constant: '<S816>/FixPt Constant' |
| 3735 | */ |
| 3736 | L4_MABX_B.FixPtSum1_p = L4_MABX_B.Init_d - L4_MABX_P.FixPtConstant_Value_g; |
| 3737 | |
| 3738 | /* Sum: '<S819>/FixPt Sum1' incorporates: |
| 3739 | * Constant: '<S819>/FixPt Constant' |
| 3740 | */ |
| 3741 | L4_MABX_B.FixPtSum1_g = L4_MABX_B.Init_d + L4_MABX_P.FixPtConstant_Value_m; |
| 3742 | |
| 3743 | /* Outputs for Atomic SubSystem: '<S782>/If_Then_Else3' */ |
| 3744 | L4_MABX_If_Then_Else(L4_MABX_B.conjunction_i, L4_MABX_B.FixPtSum1_p, |
| 3745 | L4_MABX_B.FixPtSum1_g, &L4_MABX_B.If_Then_Else3_c); |
| 3746 | |
| 3747 | /* End of Outputs for SubSystem: '<S782>/If_Then_Else3' */ |
| 3748 | |
| 3749 | /* RelationalOperator: '<S817>/Relational Operator1' incorporates: |
| 3750 | * Constant: '<S763>/PWMSynchFaultLimMax' |
| 3751 | */ |
| 3752 | L4_MABX_B.RelationalOperator1_l = (L4_MABX_B.If_Then_Else3_c.Switch >= |
| 3753 | L4_MABX_P.PWMSynchFaultLimMax_Value); |
| 3754 | |
| 3755 | /* RelationalOperator: '<S817>/Relational Operator' incorporates: |
| 3756 | * Constant: '<S763>/PWMSynchFaultLimMin' |
| 3757 | */ |
| 3758 | L4_MABX_B.RelationalOperator_a4 = (L4_MABX_B.If_Then_Else3_c.Switch <= |
| 3759 | L4_MABX_P.PWMSynchFaultLimMin_Value); |
| 3760 | |
| 3761 | /* Outputs for Atomic SubSystem: '<S817>/If_Then_Else1' */ |
| 3762 | |
| 3763 | /* Constant: '<S763>/PWMSynchFaultLimMin' */ |
| 3764 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_a4, |
| 3765 | L4_MABX_P.PWMSynchFaultLimMin_Value, |
| 3766 | L4_MABX_B.If_Then_Else3_c.Switch, |
| 3767 | &L4_MABX_B.If_Then_Else1_ky); |
| 3768 | |
| 3769 | /* End of Outputs for SubSystem: '<S817>/If_Then_Else1' */ |
| 3770 | |
| 3771 | /* Outputs for Atomic SubSystem: '<S817>/If_Then_Else' */ |
| 3772 | |
| 3773 | /* Constant: '<S763>/PWMSynchFaultLimMax' */ |
| 3774 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_l, |
| 3775 | L4_MABX_P.PWMSynchFaultLimMax_Value, |
| 3776 | L4_MABX_B.If_Then_Else1_ky.Switch, |
| 3777 | &L4_MABX_B.If_Then_Else_k2); |
| 3778 | |
| 3779 | /* End of Outputs for SubSystem: '<S817>/If_Then_Else' */ |
| 3780 | |
| 3781 | /* RelationalOperator: '<S782>/Relational Operator8' incorporates: |
| 3782 | * Constant: '<S763>/PWMSynchFaultLimMax' |
| 3783 | */ |
| 3784 | L4_MABX_B.F_Fault_Hard_ov = (L4_MABX_P.PWMSynchFaultLimMax_Value <= |
| 3785 | L4_MABX_B.If_Then_Else_k2.Switch); |
| 3786 | |
| 3787 | /* Logic: '<S744>/Logical Operator6' */ |
| 3788 | L4_MABX_B.LogicalOperator6_e = (L4_MABX_B.F_Pedal_pwm_sens_total_failure || |
| 3789 | L4_MABX_B.F_Fault_Hard_ov); |
| 3790 | |
| 3791 | /* Outputs for Enabled SubSystem: '<S744>/Slew_at_event' incorporates: |
| 3792 | * EnablePort: '<S767>/Enable' |
| 3793 | */ |
| 3794 | /* Constant: '<S744>/F_PEDAL_TORQUE_SLEW_AT_FAULT' */ |
| 3795 | if (L4_MABX_P.F_PEDAL_TORQUE_SLEW_AT_FAULT_Va) { |
| 3796 | if (!L4_MABX_DW.Slew_at_event_MODE) { |
| 3797 | /* InitializeConditions for UnitDelay: '<S838>/Unit_Delay' */ |
| 3798 | L4_MABX_DW.Unit_Delay_DSTATE_k = L4_MABX_P.Unit_Delay_InitialCondition_b10; |
| 3799 | |
| 3800 | /* InitializeConditions for UnitDelay: '<S839>/Unit_Delay' */ |
| 3801 | L4_MABX_DW.Unit_Delay_DSTATE_hv = L4_MABX_P.Unit_Delay_InitialCondition_ee; |
| 3802 | |
| 3803 | /* InitializeConditions for UnitDelay: '<S842>/FixPt Unit Delay2' */ |
| 3804 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_b = |
| 3805 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_ee; |
| 3806 | |
| 3807 | /* InitializeConditions for UnitDelay: '<S842>/FixPt Unit Delay1' */ |
| 3808 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_i = |
| 3809 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_c; |
| 3810 | |
| 3811 | /* InitializeConditions for UnitDelay: '<S837>/Unit_Delay' */ |
| 3812 | L4_MABX_DW.Unit_Delay_DSTATE_i4 = L4_MABX_P.Unit_Delay_InitialCondition_n; |
| 3813 | L4_MABX_DW.Slew_at_event_MODE = true; |
| 3814 | } |
| 3815 | |
| 3816 | /* UnitDelay: '<S838>/Unit_Delay' */ |
| 3817 | L4_MABX_B.Unit_Delay_og = L4_MABX_DW.Unit_Delay_DSTATE_k; |
| 3818 | |
| 3819 | /* Logic: '<S838>/Logical Operator1' */ |
| 3820 | L4_MABX_B.LogicalOperator1_n = !L4_MABX_B.Unit_Delay_og; |
| 3821 | |
| 3822 | /* Logic: '<S838>/Logical Operator' */ |
| 3823 | L4_MABX_B.LogicalOperator_l = (L4_MABX_B.LogicalOperator6_e && |
| 3824 | L4_MABX_B.LogicalOperator1_n); |
| 3825 | |
| 3826 | /* UnitDelay: '<S839>/Unit_Delay' */ |
| 3827 | L4_MABX_B.Unit_Delay_k1 = L4_MABX_DW.Unit_Delay_DSTATE_hv; |
| 3828 | |
| 3829 | /* Logic: '<S839>/Logical Operator1' */ |
| 3830 | L4_MABX_B.LogicalOperator1_f = (L4_MABX_B.LogicalOperator_l || |
| 3831 | L4_MABX_B.Unit_Delay_k1); |
| 3832 | |
| 3833 | /* UnitDelay: '<S842>/FixPt Unit Delay2' */ |
| 3834 | L4_MABX_B.FixPtUnitDelay2_m = L4_MABX_DW.FixPtUnitDelay2_DSTATE_b; |
| 3835 | |
| 3836 | /* UnitDelay: '<S842>/FixPt Unit Delay1' */ |
| 3837 | L4_MABX_B.Xold_m = L4_MABX_DW.FixPtUnitDelay1_DSTATE_i; |
| 3838 | |
| 3839 | /* Switch: '<S842>/Init' incorporates: |
| 3840 | * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' |
| 3841 | */ |
| 3842 | if (L4_MABX_B.FixPtUnitDelay2_m != 0) { |
| 3843 | L4_MABX_B.Init_g = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL; |
| 3844 | } else { |
| 3845 | L4_MABX_B.Init_g = L4_MABX_B.Xold_m; |
| 3846 | } |
| 3847 | |
| 3848 | /* End of Switch: '<S842>/Init' */ |
| 3849 | |
| 3850 | /* Abs: '<S839>/Abs' incorporates: |
| 3851 | * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_SLEW_UP' |
| 3852 | */ |
| 3853 | L4_MABX_B.Abs_b = fabs(L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFA_f); |
| 3854 | |
| 3855 | /* Product: '<S839>/Product1' incorporates: |
| 3856 | * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DT' |
| 3857 | */ |
| 3858 | L4_MABX_B.Product1_l = L4_MABX_B.Abs_b * |
| 3859 | L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDT_Val; |
| 3860 | |
| 3861 | /* Sum: '<S839>/Add1' */ |
| 3862 | L4_MABX_B.Add1_k = L4_MABX_B.Init_g + L4_MABX_B.Product1_l; |
| 3863 | |
| 3864 | /* MinMax: '<S839>/MinMax2' incorporates: |
| 3865 | * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' |
| 3866 | */ |
| 3867 | DeltaTime = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL; |
| 3868 | PositionFinalLimited = L4_MABX_B.Add1_k; |
| 3869 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 3870 | PositionFinalLimited = DeltaTime; |
| 3871 | } |
| 3872 | |
| 3873 | L4_MABX_B.MinMax2 = PositionFinalLimited; |
| 3874 | |
| 3875 | /* End of MinMax: '<S839>/MinMax2' */ |
| 3876 | |
| 3877 | /* Abs: '<S839>/Abs1' incorporates: |
| 3878 | * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_SLEW_DOWN' |
| 3879 | */ |
| 3880 | L4_MABX_B.Abs1 = fabs(L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFA_o); |
| 3881 | |
| 3882 | /* Product: '<S839>/Product2' incorporates: |
| 3883 | * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DT' |
| 3884 | */ |
| 3885 | L4_MABX_B.Product2_i = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDT_Val * |
| 3886 | L4_MABX_B.Abs1; |
| 3887 | |
| 3888 | /* Sum: '<S839>/Subtract1' */ |
| 3889 | L4_MABX_B.Subtract1_c = L4_MABX_B.Init_g - L4_MABX_B.Product2_i; |
| 3890 | |
| 3891 | /* MinMax: '<S839>/MinMax1' */ |
| 3892 | DeltaTime = L4_MABX_B.MinMax2; |
| 3893 | PositionFinalLimited = L4_MABX_B.Subtract1_c; |
| 3894 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 3895 | PositionFinalLimited = DeltaTime; |
| 3896 | } |
| 3897 | |
| 3898 | L4_MABX_B.MinMax1_d = PositionFinalLimited; |
| 3899 | |
| 3900 | /* End of MinMax: '<S839>/MinMax1' */ |
| 3901 | |
| 3902 | /* Outputs for Atomic SubSystem: '<S839>/If_Then_Else' */ |
| 3903 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_f, |
| 3904 | L4_MABX_B.If_Then_Else_k.Switch, L4_MABX_B.MinMax1_d, |
| 3905 | &L4_MABX_B.If_Then_Else_is); |
| 3906 | |
| 3907 | /* End of Outputs for SubSystem: '<S839>/If_Then_Else' */ |
| 3908 | |
| 3909 | /* Sum: '<S767>/Subtract' incorporates: |
| 3910 | * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' |
| 3911 | */ |
| 3912 | L4_MABX_B.Subtract_e = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL - |
| 3913 | L4_MABX_B.If_Then_Else_is.Switch; |
| 3914 | |
| 3915 | /* Abs: '<S767>/Abs' */ |
| 3916 | L4_MABX_B.Abs_c = fabs(L4_MABX_B.Subtract_e); |
| 3917 | |
| 3918 | /* RelationalOperator: '<S767>/Relational Operator1' incorporates: |
| 3919 | * Constant: '<S767>/Constant1' |
| 3920 | */ |
| 3921 | L4_MABX_B.RelationalOperator1_c4 = (L4_MABX_B.Abs_c <= |
| 3922 | L4_MABX_P.Constant1_Value_hm); |
| 3923 | |
| 3924 | /* Logic: '<S837>/Logical Operator3' */ |
| 3925 | L4_MABX_B.LogicalOperator3_f = !L4_MABX_B.RelationalOperator1_c4; |
| 3926 | |
| 3927 | /* UnitDelay: '<S837>/Unit_Delay' */ |
| 3928 | L4_MABX_B.Unit_Delay_l = L4_MABX_DW.Unit_Delay_DSTATE_i4; |
| 3929 | |
| 3930 | /* Logic: '<S837>/Logical Operator1' */ |
| 3931 | L4_MABX_B.LogicalOperator1_k = (L4_MABX_B.LogicalOperator6_e || |
| 3932 | L4_MABX_B.Unit_Delay_l); |
| 3933 | |
| 3934 | /* Logic: '<S837>/Logical Operator' */ |
| 3935 | L4_MABX_B.LogicalOperator_a = (L4_MABX_B.LogicalOperator3_f && |
| 3936 | L4_MABX_B.LogicalOperator1_k); |
| 3937 | |
| 3938 | /* Logic: '<S837>/Logical Operator2' */ |
| 3939 | L4_MABX_B.LogicalOperator2_n = !L4_MABX_B.LogicalOperator_a; |
| 3940 | |
| 3941 | /* RelationalOperator: '<S840>/min_relop' incorporates: |
| 3942 | * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_SLEW_UP' |
| 3943 | * Constant: '<S840>/min_val' |
| 3944 | */ |
| 3945 | L4_MABX_B.min_relop_b = (L4_MABX_P.CheckStaticLowerBound_min_j <= |
| 3946 | L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFA_f); |
| 3947 | |
| 3948 | /* Assertion: '<S840>/Assertion' */ |
| 3949 | utAssert(L4_MABX_B.min_relop_b); |
| 3950 | } else { |
| 3951 | if (L4_MABX_DW.Slew_at_event_MODE) { |
| 3952 | /* Disable for Outport: '<S767>/F_Out_slewing' */ |
| 3953 | L4_MABX_B.LogicalOperator_a = L4_MABX_P.F_Out_slewing_Y0_m; |
| 3954 | |
| 3955 | /* Disable for Outport: '<S767>/Out' */ |
| 3956 | L4_MABX_B.If_Then_Else_is.Switch = L4_MABX_P.Out_Y0_a; |
| 3957 | L4_MABX_DW.Slew_at_event_MODE = false; |
| 3958 | } |
| 3959 | } |
| 3960 | |
| 3961 | /* End of Constant: '<S744>/F_PEDAL_TORQUE_SLEW_AT_FAULT' */ |
| 3962 | /* End of Outputs for SubSystem: '<S744>/Slew_at_event' */ |
| 3963 | |
| 3964 | /* Outputs for Atomic SubSystem: '<S744>/If_Then_Else' */ |
| 3965 | L4_MABX_If_Then_Else_j(L4_MABX_B.LogicalOperator_a, |
| 3966 | L4_MABX_B.If_Then_Else_is.Switch, L4_MABX_B.If_Then_Else_k.Switch); |
| 3967 | |
| 3968 | /* End of Outputs for SubSystem: '<S744>/If_Then_Else' */ |
| 3969 | |
| 3970 | /* S-Function (rti_commonblock): '<S732>/S-Function1' */ |
| 3971 | /* This comment workarounds a code generation problem */ |
| 3972 | { |
| 3973 | /* dSPACE I/O Board DS1401STDADCT4 #1 Unit:ADC Group:ADC */ |
| 3974 | adc_tp4_single_new_read(ADC_TP4_1_MODULE_ADDR, |
| 3975 | ADC_TP4_CH3, |
| 3976 | (dsfloat *)&L4_MABX_B.SFunction1); |
| 3977 | } |
| 3978 | |
| 3979 | /* Gain: '<S416>/KL15_Monitor' */ |
| 3980 | L4_MABX_B.IgnitionKeySwitch_voltage = L4_MABX_P.KL15_Monitor_Gain * |
| 3981 | L4_MABX_B.SFunction1; |
| 3982 | |
| 3983 | /* Outputs for Enabled SubSystem: '<S507>/CCVS1_31' incorporates: |
| 3984 | * EnablePort: '<S508>/Enable' |
| 3985 | */ |
| 3986 | /* Constant: '<S430>/Constant' */ |
| 3987 | if (L4_MABX_P.Constant_Value_mn) { |
| 3988 | /* S-Function (rti_commonblock): '<S508>/S-Function1' */ |
| 3989 | /* This comment workarounds a code generation problem */ |
| 3990 | |
| 3991 | /* dSPACE RTICAN RX Message Block: "CCVS1_31" Id:419361073 */ |
| 3992 | { |
| 3993 | UInt32 *CAN_Msg; |
| 3994 | static dsfloat time_old = 0.0; |
| 3995 | |
| 3996 | /* Read status and timestamp info (previous message) */ |
| 3997 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF131].timestamp != |
| 3998 | time_old) { |
| 3999 | /* ... save timestamp info for the calculation of the RX status |
| 4000 | during the consecutive sample hit*/ |
| 4001 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF131]. |
| 4002 | timestamp; |
| 4003 | |
| 4004 | /* ... set the processed flag to one */ |
| 4005 | L4_MABX_B.SFunction1_o21_h = 1.0; |
| 4006 | L4_MABX_B.SFunction1_o22_f = (real_T) |
| 4007 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF131].timestamp; |
| 4008 | L4_MABX_B.SFunction1_o23_l = (real_T) |
| 4009 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF131].deltatime; |
| 4010 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF131].data; |
| 4011 | |
| 4012 | /* Decode CAN message */ |
| 4013 | { |
| 4014 | { |
| 4015 | rtican_Signal_t CAN_Sgn; |
| 4016 | |
| 4017 | /* ...... "TwoSpeedAxleSwitch" (0|2, standard signal, unsigned int, little endian) */ |
| 4018 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4019 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4020 | L4_MABX_B.SFunction1_o1_ph = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4021 | |
| 4022 | /* ...... "ParkingBrakeSwitch" (2|2, standard signal, unsigned int, little endian) */ |
| 4023 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4024 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4025 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4026 | L4_MABX_B.SFunction1_o2_bb = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4027 | |
| 4028 | /* ...... "CruiseCtrlPauseSwitch" (4|2, standard signal, unsigned int, little endian) */ |
| 4029 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4030 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4031 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4032 | L4_MABX_B.SFunction1_o3_jz = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4033 | |
| 4034 | /* ...... "ParkBrakeReleaseInhibitRq" (6|2, standard signal, unsigned int, little endian) */ |
| 4035 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4036 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4037 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4038 | L4_MABX_B.SFunction1_o4_fx = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4039 | |
| 4040 | /* ...... "WheelBasedVehicleSpeed" (8|16, standard signal, unsigned int, little endian) */ |
| 4041 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 4042 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 4043 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4044 | L4_MABX_B.SFunction1_o5_go = 0.00390625 * ( ((real_T) |
| 4045 | CAN_Sgn.UnsignedSgn) ); |
| 4046 | |
| 4047 | /* ...... "CruiseCtrlActive" (24|2, standard signal, unsigned int, little endian) */ |
| 4048 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4049 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4050 | L4_MABX_B.SFunction1_o6_nc = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4051 | |
| 4052 | /* ...... "CruiseCtrlEnableSwitch" (26|2, standard signal, unsigned int, little endian) */ |
| 4053 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4054 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4055 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4056 | L4_MABX_B.SFunction1_o7_oi = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4057 | |
| 4058 | /* ...... "BrakeSwitch" (28|2, standard signal, unsigned int, little endian) */ |
| 4059 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4060 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4061 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4062 | L4_MABX_B.SFunction1_o8_fx = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4063 | |
| 4064 | /* ...... "ClutchSwitch" (30|2, standard signal, unsigned int, little endian) */ |
| 4065 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4066 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4067 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4068 | L4_MABX_B.SFunction1_o9_dt = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4069 | |
| 4070 | /* ...... "CruiseCtrlSetSwitch" (32|2, standard signal, unsigned int, little endian) */ |
| 4071 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4072 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4073 | L4_MABX_B.SFunction1_o10_a2 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4074 | |
| 4075 | /* ...... "CruiseCtrlCoastSwitch" (34|2, standard signal, unsigned int, little endian) */ |
| 4076 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4077 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4078 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4079 | L4_MABX_B.SFunction1_o11_f = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4080 | |
| 4081 | /* ...... "CruiseCtrlResumeSwitch" (36|2, standard signal, unsigned int, little endian) */ |
| 4082 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4083 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4084 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4085 | L4_MABX_B.SFunction1_o12_e = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4086 | |
| 4087 | /* ...... "CruiseCtrlAccelerateSwitch" (38|2, standard signal, unsigned int, little endian) */ |
| 4088 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4089 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4090 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4091 | L4_MABX_B.SFunction1_o13_p0 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4092 | |
| 4093 | /* ...... "CruiseCtrlSetSpeed" (40|8, standard signal, unsigned int, little endian) */ |
| 4094 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 4095 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4096 | L4_MABX_B.SFunction1_o14_h = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4097 | |
| 4098 | /* ...... "PTOGovernorState" (48|5, standard signal, unsigned int, little endian) */ |
| 4099 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4100 | CAN_Sgn.UnsignedSgn &= 0x0000001F; |
| 4101 | L4_MABX_B.SFunction1_o15_m = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4102 | |
| 4103 | /* ...... "CruiseCtrlStates" (53|3, standard signal, unsigned int, little endian) */ |
| 4104 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4105 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 5; |
| 4106 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 4107 | L4_MABX_B.SFunction1_o16_j = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4108 | |
| 4109 | /* ...... "EngIdleIncrementSwitch" (56|2, standard signal, unsigned int, little endian) */ |
| 4110 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4111 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4112 | L4_MABX_B.SFunction1_o17_m = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4113 | |
| 4114 | /* ...... "EngIdleDecrementSwitch" (58|2, standard signal, unsigned int, little endian) */ |
| 4115 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4116 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4117 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4118 | L4_MABX_B.SFunction1_o18_n4 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4119 | |
| 4120 | /* ...... "EngTestModeSwitch" (60|2, standard signal, unsigned int, little endian) */ |
| 4121 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4122 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4123 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4124 | L4_MABX_B.SFunction1_o19_lj = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4125 | |
| 4126 | /* ...... "EngShutdownOverrideSwitch" (62|2, standard signal, unsigned int, little endian) */ |
| 4127 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4128 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4129 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4130 | L4_MABX_B.SFunction1_o20_m = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4131 | } |
| 4132 | } |
| 4133 | } else { |
| 4134 | /* set RX status to 0 because no new message has arrived */ |
| 4135 | L4_MABX_B.SFunction1_o21_h = 0.0; |
| 4136 | } |
| 4137 | } |
| 4138 | } |
| 4139 | |
| 4140 | /* End of Constant: '<S430>/Constant' */ |
| 4141 | /* End of Outputs for SubSystem: '<S507>/CCVS1_31' */ |
| 4142 | |
| 4143 | /* Outputs for Enabled SubSystem: '<S518>/EBC2_0B1' incorporates: |
| 4144 | * EnablePort: '<S519>/Enable' |
| 4145 | */ |
| 4146 | /* Constant: '<S435>/Enable_RX_EBC2_0B' */ |
| 4147 | if (L4_MABX_P.Enable_RX_EBC2_0B_Value) { |
| 4148 | /* S-Function (rti_commonblock): '<S519>/S-Function1' */ |
| 4149 | /* This comment workarounds a code generation problem */ |
| 4150 | |
| 4151 | /* dSPACE RTICAN RX Message Block: "EBC2_0B" Id:419348235 */ |
| 4152 | { |
| 4153 | UInt32 *CAN_Msg; |
| 4154 | static dsfloat time_old = 0.0; |
| 4155 | |
| 4156 | /* Read status and timestamp info (previous message) */ |
| 4157 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEBF0B].timestamp != |
| 4158 | time_old) { |
| 4159 | /* ... save timestamp info for the calculation of the RX status |
| 4160 | during the consecutive sample hit*/ |
| 4161 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEBF0B]. |
| 4162 | timestamp; |
| 4163 | |
| 4164 | /* ... set the processed flag to one */ |
| 4165 | L4_MABX_B.SFunction1_o8_c = 1.0; |
| 4166 | L4_MABX_B.SFunction1_o9_aj = (real_T) |
| 4167 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEBF0B].timestamp; |
| 4168 | L4_MABX_B.SFunction1_o10_gi = (real_T) |
| 4169 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEBF0B].deltatime; |
| 4170 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEBF0B].data; |
| 4171 | |
| 4172 | /* Decode CAN message */ |
| 4173 | { |
| 4174 | { |
| 4175 | rtican_Signal_t CAN_Sgn; |
| 4176 | |
| 4177 | /* ...... "FrontAxleSpeed" (0|16, standard signal, unsigned int, little endian) */ |
| 4178 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4179 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 4180 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4181 | L4_MABX_B.SFunction1_o1_ee = 0.00390625 * ( ((real_T) |
| 4182 | CAN_Sgn.UnsignedSgn) ); |
| 4183 | |
| 4184 | /* ...... "RelativeSpeedFrontAxleLeftWheel" (16|8, standard signal, unsigned int, little endian) */ |
| 4185 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4186 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4187 | L4_MABX_B.SFunction1_o2_eu = -7.8125 + ( 0.0625 * ( ((real_T) |
| 4188 | CAN_Sgn.UnsignedSgn) ) ); |
| 4189 | |
| 4190 | /* ...... "RlativeSpeedFrontAxleRightWheel" (24|8, standard signal, unsigned int, little endian) */ |
| 4191 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4192 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4193 | L4_MABX_B.SFunction1_o3_fx = -7.8125 + ( 0.0625 * ( ((real_T) |
| 4194 | CAN_Sgn.UnsignedSgn) ) ); |
| 4195 | |
| 4196 | /* ...... "RelativeSpeedRearAxle1LeftWheel" (32|8, standard signal, unsigned int, little endian) */ |
| 4197 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4198 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4199 | L4_MABX_B.SFunction1_o4_as = -7.8125 + ( 0.0625 * ( ((real_T) |
| 4200 | CAN_Sgn.UnsignedSgn) ) ); |
| 4201 | |
| 4202 | /* ...... "RlativeSpeedRearAxle1RightWheel" (40|8, standard signal, unsigned int, little endian) */ |
| 4203 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 4204 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4205 | L4_MABX_B.SFunction1_o5_aq = -7.8125 + ( 0.0625 * ( ((real_T) |
| 4206 | CAN_Sgn.UnsignedSgn) ) ); |
| 4207 | |
| 4208 | /* ...... "RelativeSpeedRearAxle2LeftWheel" (48|8, standard signal, unsigned int, little endian) */ |
| 4209 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4210 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4211 | L4_MABX_B.SFunction1_o6_on = -7.8125 + ( 0.0625 * ( ((real_T) |
| 4212 | CAN_Sgn.UnsignedSgn) ) ); |
| 4213 | |
| 4214 | /* ...... "RlativeSpeedRearAxle2RightWheel" (56|8, standard signal, unsigned int, little endian) */ |
| 4215 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4216 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4217 | L4_MABX_B.SFunction1_o7_n = -7.8125 + ( 0.0625 * ( ((real_T) |
| 4218 | CAN_Sgn.UnsignedSgn) ) ); |
| 4219 | } |
| 4220 | } |
| 4221 | } else { |
| 4222 | /* set RX status to 0 because no new message has arrived */ |
| 4223 | L4_MABX_B.SFunction1_o8_c = 0.0; |
| 4224 | } |
| 4225 | } |
| 4226 | } |
| 4227 | |
| 4228 | /* End of Constant: '<S435>/Enable_RX_EBC2_0B' */ |
| 4229 | /* End of Outputs for SubSystem: '<S518>/EBC2_0B1' */ |
| 4230 | |
| 4231 | /* Outputs for Enabled SubSystem: '<S576>/HRW_0B' incorporates: |
| 4232 | * EnablePort: '<S577>/Enable' |
| 4233 | */ |
| 4234 | /* Constant: '<S442>/Enable_HRW_RX_0B' */ |
| 4235 | if (L4_MABX_P.Enable_HRW_RX_0B_Value) { |
| 4236 | /* S-Function (rti_commonblock): '<S577>/S-Function1' */ |
| 4237 | /* This comment workarounds a code generation problem */ |
| 4238 | |
| 4239 | /* dSPACE RTICAN RX Message Block: "HRW_0B" Id:150892043 */ |
| 4240 | { |
| 4241 | UInt32 *CAN_Msg; |
| 4242 | static dsfloat time_old = 0.0; |
| 4243 | |
| 4244 | /* Read status and timestamp info (previous message) */ |
| 4245 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x8FE6E0B].timestamp != |
| 4246 | time_old) { |
| 4247 | /* ... save timestamp info for the calculation of the RX status |
| 4248 | during the consecutive sample hit*/ |
| 4249 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x8FE6E0B]. |
| 4250 | timestamp; |
| 4251 | |
| 4252 | /* ... set the processed flag to one */ |
| 4253 | L4_MABX_B.SFunction1_o5_j1 = 1.0; |
| 4254 | L4_MABX_B.SFunction1_o6_gz = (real_T) |
| 4255 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x8FE6E0B].timestamp; |
| 4256 | L4_MABX_B.SFunction1_o7_iy = (real_T) |
| 4257 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x8FE6E0B].deltatime; |
| 4258 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x8FE6E0B].data; |
| 4259 | |
| 4260 | /* Decode CAN message */ |
| 4261 | { |
| 4262 | { |
| 4263 | rtican_Signal_t CAN_Sgn; |
| 4264 | |
| 4265 | /* ...... "FrontAxleLeftWheelSpeed" (0|16, standard signal, unsigned int, little endian) */ |
| 4266 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4267 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 4268 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4269 | L4_MABX_B.SFunction1_o1_ag = 0.00390625 * ( ((real_T) |
| 4270 | CAN_Sgn.UnsignedSgn) ); |
| 4271 | |
| 4272 | /* ...... "FrontAxleRightWheelSpeed" (16|16, standard signal, unsigned int, little endian) */ |
| 4273 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4274 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 4275 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4276 | L4_MABX_B.SFunction1_o2_na = 0.00390625 * ( ((real_T) |
| 4277 | CAN_Sgn.UnsignedSgn) ); |
| 4278 | |
| 4279 | /* ...... "RearAxleLeftWheelSpeed" (32|16, standard signal, unsigned int, little endian) */ |
| 4280 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4281 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 4282 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4283 | L4_MABX_B.SFunction1_o3_bm = 0.00390625 * ( ((real_T) |
| 4284 | CAN_Sgn.UnsignedSgn) ); |
| 4285 | |
| 4286 | /* ...... "RearAxleRightWheelSpeed" (48|16, standard signal, unsigned int, little endian) */ |
| 4287 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4288 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[7]; |
| 4289 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4290 | L4_MABX_B.SFunction1_o4_awa = 0.00390625 * ( ((real_T) |
| 4291 | CAN_Sgn.UnsignedSgn) ); |
| 4292 | } |
| 4293 | } |
| 4294 | } else { |
| 4295 | /* set RX status to 0 because no new message has arrived */ |
| 4296 | L4_MABX_B.SFunction1_o5_j1 = 0.0; |
| 4297 | } |
| 4298 | } |
| 4299 | } |
| 4300 | |
| 4301 | /* End of Constant: '<S442>/Enable_HRW_RX_0B' */ |
| 4302 | /* End of Outputs for SubSystem: '<S576>/HRW_0B' */ |
| 4303 | |
| 4304 | /* Outputs for Enabled SubSystem: '<S516>/EBC1_0B' incorporates: |
| 4305 | * EnablePort: '<S517>/Enable' |
| 4306 | */ |
| 4307 | /* Constant: '<S434>/Constant1' */ |
| 4308 | if (L4_MABX_P.Constant1_Value_iz) { |
| 4309 | /* S-Function (rti_commonblock): '<S517>/S-Function1' */ |
| 4310 | /* This comment workarounds a code generation problem */ |
| 4311 | |
| 4312 | /* dSPACE RTICAN RX Message Block: "EBC1_0B" Id:418382219 */ |
| 4313 | { |
| 4314 | UInt32 *CAN_Msg; |
| 4315 | static dsfloat time_old = 0.0; |
| 4316 | |
| 4317 | /* Read status and timestamp info (previous message) */ |
| 4318 | if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18F0018B].timestamp != |
| 4319 | time_old) { |
| 4320 | /* ... save timestamp info for the calculation of the RX status |
| 4321 | during the consecutive sample hit*/ |
| 4322 | time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18F0018B]. |
| 4323 | timestamp; |
| 4324 | |
| 4325 | /* ... set the processed flag to one */ |
| 4326 | L4_MABX_B.SFunction1_o23_p = 1.0; |
| 4327 | L4_MABX_B.SFunction1_o24_d = (real_T) |
| 4328 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18F0018B].timestamp; |
| 4329 | L4_MABX_B.SFunction1_o25_b = (real_T) |
| 4330 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18F0018B].deltatime; |
| 4331 | CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18F0018B].data; |
| 4332 | |
| 4333 | /* Decode CAN message */ |
| 4334 | { |
| 4335 | { |
| 4336 | rtican_Signal_t CAN_Sgn; |
| 4337 | |
| 4338 | /* ...... "ASREngCtrlActive" (0|2, standard signal, unsigned int, little endian) */ |
| 4339 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4340 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4341 | L4_MABX_B.SFunction1_o1_ir = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4342 | |
| 4343 | /* ...... "ASRBrakeCtrlActive" (2|2, standard signal, unsigned int, little endian) */ |
| 4344 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4345 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4346 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4347 | L4_MABX_B.SFunction1_o2_cb = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4348 | |
| 4349 | /* ...... "AntiLockBrakingActive" (4|2, standard signal, unsigned int, little endian) */ |
| 4350 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4351 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4352 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4353 | L4_MABX_B.SFunction1_o3_i1 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4354 | |
| 4355 | /* ...... "EBSBrakeSwitch" (6|2, standard signal, unsigned int, little endian) */ |
| 4356 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4357 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4358 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4359 | L4_MABX_B.SFunction1_o4_mt = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4360 | |
| 4361 | /* ...... "BrakePedalPos" (8|8, standard signal, unsigned int, little endian) */ |
| 4362 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 4363 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4364 | L4_MABX_B.SFunction1_o5_ma = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 4365 | |
| 4366 | /* ...... "ABSOffroadSwitch" (16|2, standard signal, unsigned int, little endian) */ |
| 4367 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4368 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4369 | L4_MABX_B.SFunction1_o6_ho = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4370 | |
| 4371 | /* ...... "ASROffroadSwitch" (18|2, standard signal, unsigned int, little endian) */ |
| 4372 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4373 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4374 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4375 | L4_MABX_B.SFunction1_o7_kf = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4376 | |
| 4377 | /* ...... "ASRHillHolderSwitch" (20|2, standard signal, unsigned int, little endian) */ |
| 4378 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4379 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4380 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4381 | L4_MABX_B.SFunction1_o8_pf = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4382 | |
| 4383 | /* ...... "TractionCtrlOverrideSwitch" (22|2, standard signal, unsigned int, little endian) */ |
| 4384 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4385 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4386 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4387 | L4_MABX_B.SFunction1_o9_oj = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4388 | |
| 4389 | /* ...... "AccelInterlockSwitch" (24|2, standard signal, unsigned int, little endian) */ |
| 4390 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4391 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4392 | L4_MABX_B.SFunction1_o10_d = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4393 | |
| 4394 | /* ...... "EngDerateSwitch" (26|2, standard signal, unsigned int, little endian) */ |
| 4395 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4396 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4397 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4398 | L4_MABX_B.SFunction1_o11_m = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4399 | |
| 4400 | /* ...... "EngAuxShutdownSwitch" (28|2, standard signal, unsigned int, little endian) */ |
| 4401 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4402 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4403 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4404 | L4_MABX_B.SFunction1_o12_b = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4405 | |
| 4406 | /* ...... "RemoteAccelEnableSwitch" (30|2, standard signal, unsigned int, little endian) */ |
| 4407 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4408 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4409 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4410 | L4_MABX_B.SFunction1_o13_p = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4411 | |
| 4412 | /* ...... "EngRetarderSelection" (32|8, standard signal, unsigned int, little endian) */ |
| 4413 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4414 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4415 | L4_MABX_B.SFunction1_o14_e = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 4416 | |
| 4417 | /* ...... "ABSFullyOperational" (40|2, standard signal, unsigned int, little endian) */ |
| 4418 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 4419 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4420 | L4_MABX_B.SFunction1_o15_j = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4421 | |
| 4422 | /* ...... "EBSRedWarningSignal" (42|2, standard signal, unsigned int, little endian) */ |
| 4423 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 4424 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4425 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4426 | L4_MABX_B.SFunction1_o16_f = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4427 | |
| 4428 | /* ...... "ABS_EBSAmberWarningSignal" (44|2, standard signal, unsigned int, little endian) */ |
| 4429 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 4430 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4431 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4432 | L4_MABX_B.SFunction1_o17_h = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4433 | |
| 4434 | /* ...... "ATC_ASRInformationSignal" (46|2, standard signal, unsigned int, little endian) */ |
| 4435 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 4436 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4437 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4438 | L4_MABX_B.SFunction1_o18_o = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4439 | |
| 4440 | /* ...... "SrcAddrssOfCtrllngDvcFrBrkCntrl" (48|8, standard signal, unsigned int, little endian) */ |
| 4441 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4442 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4443 | L4_MABX_B.SFunction1_o19_f = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4444 | |
| 4445 | /* ...... "HaltBrakeSwitch" (58|2, standard signal, unsigned int, little endian) */ |
| 4446 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4447 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4448 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4449 | L4_MABX_B.SFunction1_o20_g = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4450 | |
| 4451 | /* ...... "TrailerABSStatus" (60|2, standard signal, unsigned int, little endian) */ |
| 4452 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4453 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4454 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4455 | L4_MABX_B.SFunction1_o21_f = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4456 | |
| 4457 | /* ...... "TrctrMntdTrilerABSWarningSignal" (62|2, standard signal, unsigned int, little endian) */ |
| 4458 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4459 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4460 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4461 | L4_MABX_B.SFunction1_o22_k = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4462 | } |
| 4463 | } |
| 4464 | } else { |
| 4465 | /* set RX status to 0 because no new message has arrived */ |
| 4466 | L4_MABX_B.SFunction1_o23_p = 0.0; |
| 4467 | } |
| 4468 | } |
| 4469 | } |
| 4470 | |
| 4471 | /* End of Constant: '<S434>/Constant1' */ |
| 4472 | /* End of Outputs for SubSystem: '<S516>/EBC1_0B' */ |
| 4473 | |
| 4474 | /* Outputs for Enabled SubSystem: '<S571>/ETC2_031' incorporates: |
| 4475 | * EnablePort: '<S572>/Enable' |
| 4476 | */ |
| 4477 | /* Constant: '<S440>/Enable_RX_ETC2_03' */ |
| 4478 | if (L4_MABX_P.Enable_RX_ETC2_03_Value) { |
| 4479 | /* S-Function (rti_commonblock): '<S572>/S-Function1' */ |
| 4480 | /* This comment workarounds a code generation problem */ |
| 4481 | |
| 4482 | /* dSPACE RTICAN RX Message Block: "ETC2_03" Id:418383107 */ |
| 4483 | { |
| 4484 | UInt32 *CAN_Msg; |
| 4485 | static dsfloat time_old = 0.0; |
| 4486 | |
| 4487 | /* Read status and timestamp info (previous message) */ |
| 4488 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F00503].timestamp != |
| 4489 | time_old) { |
| 4490 | /* ... save timestamp info for the calculation of the RX status |
| 4491 | during the consecutive sample hit*/ |
| 4492 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F00503]. |
| 4493 | timestamp; |
| 4494 | |
| 4495 | /* ... set the processed flag to one */ |
| 4496 | L4_MABX_B.SFunction1_o4_b2 = 1.0; |
| 4497 | L4_MABX_B.SFunction1_o5_id = (real_T) |
| 4498 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F00503].timestamp; |
| 4499 | L4_MABX_B.SFunction1_o6_ks = (real_T) |
| 4500 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F00503].deltatime; |
| 4501 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F00503].data; |
| 4502 | |
| 4503 | /* Decode CAN message */ |
| 4504 | { |
| 4505 | { |
| 4506 | rtican_Signal_t CAN_Sgn; |
| 4507 | |
| 4508 | /* ...... "SPN524_TransSelectedGear" (0|8, standard signal, unsigned int, little endian) */ |
| 4509 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4510 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4511 | L4_MABX_B.SFunction1_o1_m5 = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 4512 | ); |
| 4513 | |
| 4514 | /* ...... "SPN526_TransActualGearRatio" (8|16, standard signal, unsigned int, little endian) */ |
| 4515 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 4516 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 4517 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4518 | L4_MABX_B.SFunction1_o2_lmj = 0.001 * ( ((real_T) |
| 4519 | CAN_Sgn.UnsignedSgn) ); |
| 4520 | |
| 4521 | /* ...... "SPN523_TransCurrentGear" (24|8, standard signal, unsigned int, little endian) */ |
| 4522 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4523 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4524 | L4_MABX_B.SFunction1_o3_g3 = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 4525 | ); |
| 4526 | } |
| 4527 | } |
| 4528 | } else { |
| 4529 | /* set RX status to 0 because no new message has arrived */ |
| 4530 | L4_MABX_B.SFunction1_o4_b2 = 0.0; |
| 4531 | } |
| 4532 | } |
| 4533 | } |
| 4534 | |
| 4535 | /* End of Constant: '<S440>/Enable_RX_ETC2_03' */ |
| 4536 | /* End of Outputs for SubSystem: '<S571>/ETC2_031' */ |
| 4537 | |
| 4538 | /* DataTypeConversion: '<S571>/Data Type Conversion1' */ |
| 4539 | L4_MABX_B.SPN524_TransSelectedGear = L4_MABX_B.SFunction1_o1_m5; |
| 4540 | |
| 4541 | /* DataTypeConversion: '<S571>/Data Type Conversion2' */ |
| 4542 | L4_MABX_B.SPN523_TransCurrentGear = L4_MABX_B.SFunction1_o3_g3; |
| 4543 | |
| 4544 | /* DataTypeConversion: '<S571>/Data Type Conversion3' */ |
| 4545 | L4_MABX_B.SPN526_TransActualGearRatio = L4_MABX_B.SFunction1_o2_lmj; |
| 4546 | |
| 4547 | /* Outputs for Enabled SubSystem: '<S565>/EEC1_001' incorporates: |
| 4548 | * EnablePort: '<S566>/Enable' |
| 4549 | */ |
| 4550 | /* Constant: '<S437>/Enable_RX_EEC1_00' */ |
| 4551 | if (L4_MABX_P.Enable_RX_EEC1_00_Value) { |
| 4552 | /* S-Function (rti_commonblock): '<S566>/S-Function1' */ |
| 4553 | /* This comment workarounds a code generation problem */ |
| 4554 | |
| 4555 | /* dSPACE RTICAN RX Message Block: "EEC1_00" Id:217056256 */ |
| 4556 | { |
| 4557 | UInt32 *CAN_Msg; |
| 4558 | static dsfloat time_old = 0.0; |
| 4559 | |
| 4560 | /* Read status and timestamp info (previous message) */ |
| 4561 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF00400].timestamp != |
| 4562 | time_old) { |
| 4563 | /* ... save timestamp info for the calculation of the RX status |
| 4564 | during the consecutive sample hit*/ |
| 4565 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF00400]. |
| 4566 | timestamp; |
| 4567 | |
| 4568 | /* ... set the processed flag to one */ |
| 4569 | L4_MABX_B.SFunction1_o9_jd = 1.0; |
| 4570 | L4_MABX_B.SFunction1_o10_f = (real_T) |
| 4571 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF00400].timestamp; |
| 4572 | L4_MABX_B.SFunction1_o11_g = (real_T) |
| 4573 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF00400].deltatime; |
| 4574 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF00400].data; |
| 4575 | |
| 4576 | /* Decode CAN message */ |
| 4577 | { |
| 4578 | { |
| 4579 | rtican_Signal_t CAN_Sgn; |
| 4580 | |
| 4581 | /* ...... "EngTorqueMode" (0|4, standard signal, unsigned int, little endian) */ |
| 4582 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4583 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 4584 | L4_MABX_B.SFunction1_o1_j3 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4585 | |
| 4586 | /* ...... "ActlEngPrcntTrqueHighResolution" (4|4, standard signal, unsigned int, little endian) */ |
| 4587 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4588 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4589 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 4590 | L4_MABX_B.SFunction1_o2_eg = 0.125 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 4591 | ); |
| 4592 | |
| 4593 | /* ...... "DriversDemandEngPercentTorque" (8|8, standard signal, unsigned int, little endian) */ |
| 4594 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 4595 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4596 | L4_MABX_B.SFunction1_o3_lv = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 4597 | ); |
| 4598 | |
| 4599 | /* ...... "ActualEngPercentTorque" (16|8, standard signal, unsigned int, little endian) */ |
| 4600 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4601 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4602 | L4_MABX_B.SFunction1_o4_jq = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 4603 | ); |
| 4604 | |
| 4605 | /* ...... "EngSpeed" (24|16, standard signal, unsigned int, little endian) */ |
| 4606 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4607 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 4608 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4609 | L4_MABX_B.SFunction1_o5_l = 0.125 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 4610 | ); |
| 4611 | |
| 4612 | /* ...... "SrcAddrssOfCtrllngDvcFrEngCntrl" (40|8, standard signal, unsigned int, little endian) */ |
| 4613 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 4614 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4615 | L4_MABX_B.SFunction1_o6_o = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4616 | |
| 4617 | /* ...... "EngStarterMode" (48|4, standard signal, unsigned int, little endian) */ |
| 4618 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4619 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 4620 | L4_MABX_B.SFunction1_o7_i3 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4621 | |
| 4622 | /* ...... "EngDemandPercentTorque" (56|8, standard signal, unsigned int, little endian) */ |
| 4623 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4624 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4625 | L4_MABX_B.SFunction1_o8_e = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 4626 | } |
| 4627 | } |
| 4628 | } else { |
| 4629 | /* set RX status to 0 because no new message has arrived */ |
| 4630 | L4_MABX_B.SFunction1_o9_jd = 0.0; |
| 4631 | } |
| 4632 | } |
| 4633 | } |
| 4634 | |
| 4635 | /* End of Constant: '<S437>/Enable_RX_EEC1_00' */ |
| 4636 | /* End of Outputs for SubSystem: '<S565>/EEC1_001' */ |
| 4637 | |
| 4638 | /* Outputs for Enabled SubSystem: '<S569>/EEC3_001' incorporates: |
| 4639 | * EnablePort: '<S570>/Enable' |
| 4640 | */ |
| 4641 | /* Constant: '<S439>/Enable_RX_EEC3_00' */ |
| 4642 | if (L4_MABX_P.Enable_RX_EEC3_00_Value) { |
| 4643 | /* S-Function (rti_commonblock): '<S570>/S-Function1' */ |
| 4644 | /* This comment workarounds a code generation problem */ |
| 4645 | |
| 4646 | /* dSPACE RTICAN RX Message Block: "EEC3_00" Id:419356416 */ |
| 4647 | { |
| 4648 | UInt32 *CAN_Msg; |
| 4649 | static dsfloat time_old = 0.0; |
| 4650 | |
| 4651 | /* Read status and timestamp info (previous message) */ |
| 4652 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEDF00].timestamp != |
| 4653 | time_old) { |
| 4654 | /* ... save timestamp info for the calculation of the RX status |
| 4655 | during the consecutive sample hit*/ |
| 4656 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEDF00]. |
| 4657 | timestamp; |
| 4658 | |
| 4659 | /* ... set the processed flag to one */ |
| 4660 | L4_MABX_B.SFunction1_o3_jb = 1.0; |
| 4661 | L4_MABX_B.SFunction1_o4_of = (real_T) |
| 4662 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEDF00].timestamp; |
| 4663 | L4_MABX_B.SFunction1_o5_i1 = (real_T) |
| 4664 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEDF00].deltatime; |
| 4665 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEDF00].data; |
| 4666 | |
| 4667 | /* Decode CAN message */ |
| 4668 | { |
| 4669 | { |
| 4670 | rtican_Signal_t CAN_Sgn; |
| 4671 | |
| 4672 | /* ...... "SPN514_NominalFrictionPercentTorque" (0|8, standard signal, unsigned int, little endian) */ |
| 4673 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4674 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4675 | L4_MABX_B.SFunction1_o1_f4 = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 4676 | ); |
| 4677 | |
| 4678 | /* ...... "SPN2978_EstEngParasiticLossesPercentTorque" (32|8, standard signal, unsigned int, little endian) */ |
| 4679 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4680 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4681 | L4_MABX_B.SFunction1_o2_d3 = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 4682 | ); |
| 4683 | } |
| 4684 | } |
| 4685 | } else { |
| 4686 | /* set RX status to 0 because no new message has arrived */ |
| 4687 | L4_MABX_B.SFunction1_o3_jb = 0.0; |
| 4688 | } |
| 4689 | } |
| 4690 | } |
| 4691 | |
| 4692 | /* End of Constant: '<S439>/Enable_RX_EEC3_00' */ |
| 4693 | /* End of Outputs for SubSystem: '<S569>/EEC3_001' */ |
| 4694 | |
| 4695 | /* DataTypeConversion: '<S569>/Data Type Conversion2' */ |
| 4696 | L4_MABX_B.SPN514_NominalFrictionPercentTo = L4_MABX_B.SFunction1_o1_f4; |
| 4697 | |
| 4698 | /* DataTypeConversion: '<S569>/Data Type Conversion1' */ |
| 4699 | L4_MABX_B.SPN2978_EstEngParasiticLossesPe = L4_MABX_B.SFunction1_o2_d3; |
| 4700 | |
| 4701 | /* Outputs for Enabled SubSystem: '<S512>/CVW_0B1' incorporates: |
| 4702 | * EnablePort: '<S513>/Enable' |
| 4703 | */ |
| 4704 | /* Constant: '<S432>/Constant' */ |
| 4705 | if (L4_MABX_P.Constant_Value_ir2) { |
| 4706 | /* S-Function (rti_commonblock): '<S513>/S-Function1' */ |
| 4707 | /* This comment workarounds a code generation problem */ |
| 4708 | |
| 4709 | /* dSPACE RTICAN RX Message Block: "CVW_0B" Id:419328011 */ |
| 4710 | { |
| 4711 | UInt32 *CAN_Msg; |
| 4712 | static dsfloat time_old = 0.0; |
| 4713 | |
| 4714 | /* Read status and timestamp info (previous message) */ |
| 4715 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE700B].timestamp != |
| 4716 | time_old) { |
| 4717 | /* ... save timestamp info for the calculation of the RX status |
| 4718 | during the consecutive sample hit*/ |
| 4719 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE700B]. |
| 4720 | timestamp; |
| 4721 | |
| 4722 | /* ... set the processed flag to one */ |
| 4723 | L4_MABX_B.SFunction1_o2_ln = 1.0; |
| 4724 | L4_MABX_B.SFunction1_o3_ji = (real_T) |
| 4725 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE700B].timestamp; |
| 4726 | L4_MABX_B.SFunction1_o4_fk = (real_T) |
| 4727 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE700B].deltatime; |
| 4728 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE700B].data; |
| 4729 | |
| 4730 | /* Decode CAN message */ |
| 4731 | { |
| 4732 | { |
| 4733 | rtican_Signal_t CAN_Sgn; |
| 4734 | |
| 4735 | /* ...... "SPN1760_GrossCombinationVehicleWeight" (16|16, standard signal, unsigned int, little endian) */ |
| 4736 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4737 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 4738 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4739 | L4_MABX_B.SFunction1_o1_h5 = 10 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 4740 | } |
| 4741 | } |
| 4742 | } else { |
| 4743 | /* set RX status to 0 because no new message has arrived */ |
| 4744 | L4_MABX_B.SFunction1_o2_ln = 0.0; |
| 4745 | } |
| 4746 | } |
| 4747 | } |
| 4748 | |
| 4749 | /* End of Constant: '<S432>/Constant' */ |
| 4750 | /* End of Outputs for SubSystem: '<S512>/CVW_0B1' */ |
| 4751 | |
| 4752 | /* DataTypeConversion: '<S512>/Data Type Conversion1' */ |
| 4753 | L4_MABX_B.SPN1760_GrossCombinationVehicle = L4_MABX_B.SFunction1_o1_h5; |
| 4754 | |
| 4755 | /* Outputs for Enabled SubSystem: '<S493>/ACC1_2A_' incorporates: |
| 4756 | * EnablePort: '<S494>/Enable' |
| 4757 | */ |
| 4758 | /* Constant: '<S423>/Constant' */ |
| 4759 | if (L4_MABX_P.Constant_Value_op) { |
| 4760 | /* S-Function (rti_commonblock): '<S494>/S-Function1' */ |
| 4761 | /* This comment workarounds a code generation problem */ |
| 4762 | |
| 4763 | /* dSPACE RTICAN RX Message Block: "ACC1_2A" Id:285110058 */ |
| 4764 | { |
| 4765 | UInt32 *CAN_Msg; |
| 4766 | static dsfloat time_old = 0.0; |
| 4767 | |
| 4768 | /* Read status and timestamp info (previous message) */ |
| 4769 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x10FE6F2A].timestamp != |
| 4770 | time_old) { |
| 4771 | /* ... save timestamp info for the calculation of the RX status |
| 4772 | during the consecutive sample hit*/ |
| 4773 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x10FE6F2A]. |
| 4774 | timestamp; |
| 4775 | |
| 4776 | /* ... set the processed flag to one */ |
| 4777 | L4_MABX_B.SFunction1_o11_gx = 1.0; |
| 4778 | L4_MABX_B.SFunction1_o12_o = (real_T) |
| 4779 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x10FE6F2A].timestamp; |
| 4780 | L4_MABX_B.SFunction1_o13_be = (real_T) |
| 4781 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x10FE6F2A].deltatime; |
| 4782 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x10FE6F2A].data; |
| 4783 | |
| 4784 | /* Decode CAN message */ |
| 4785 | { |
| 4786 | { |
| 4787 | rtican_Signal_t CAN_Sgn; |
| 4788 | |
| 4789 | /* ...... "SpeedOfForwardVehicle" (0|8, standard signal, unsigned int, little endian) */ |
| 4790 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4791 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4792 | L4_MABX_B.SFunction1_o1_da = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4793 | |
| 4794 | /* ...... "DistanceToForwardVehicle" (8|8, standard signal, unsigned int, little endian) */ |
| 4795 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 4796 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4797 | L4_MABX_B.SFunction1_o2_f0 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4798 | |
| 4799 | /* ...... "AdaptiveCruiseCtrlSetSpeed" (16|8, standard signal, unsigned int, little endian) */ |
| 4800 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4801 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4802 | L4_MABX_B.SFunction1_o3_ef = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4803 | |
| 4804 | /* ...... "AdaptiveCruiseCtrlMode" (24|3, standard signal, unsigned int, little endian) */ |
| 4805 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4806 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 4807 | L4_MABX_B.SFunction1_o4_b32 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4808 | |
| 4809 | /* ...... "AdptveCruiseCtrlSetDistanceMode" (27|3, standard signal, unsigned int, little endian) */ |
| 4810 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4811 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 3; |
| 4812 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 4813 | L4_MABX_B.SFunction1_o5_h = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4814 | |
| 4815 | /* ...... "RoadCurvature" (32|16, standard signal, unsigned int, little endian) */ |
| 4816 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4817 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 4818 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 4819 | L4_MABX_B.SFunction1_o6_px = -250 + ( 0.0078125 * ( ((real_T) |
| 4820 | CAN_Sgn.UnsignedSgn) ) ); |
| 4821 | |
| 4822 | /* ...... "ACCTargetDetected" (48|2, standard signal, unsigned int, little endian) */ |
| 4823 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4824 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4825 | L4_MABX_B.SFunction1_o7_h = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4826 | |
| 4827 | /* ...... "ACCSystemShutoffWarning" (50|2, standard signal, unsigned int, little endian) */ |
| 4828 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4829 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 4830 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4831 | L4_MABX_B.SFunction1_o8_gf = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4832 | |
| 4833 | /* ...... "ACCDistanceAlertSignal" (52|2, standard signal, unsigned int, little endian) */ |
| 4834 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4835 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 4836 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4837 | L4_MABX_B.SFunction1_o9_jm = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4838 | |
| 4839 | /* ...... "ForwardCollisionWarning" (54|2, standard signal, unsigned int, little endian) */ |
| 4840 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4841 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 4842 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 4843 | L4_MABX_B.SFunction1_o10_e = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4844 | } |
| 4845 | } |
| 4846 | } else { |
| 4847 | /* set RX status to 0 because no new message has arrived */ |
| 4848 | L4_MABX_B.SFunction1_o11_gx = 0.0; |
| 4849 | } |
| 4850 | } |
| 4851 | } |
| 4852 | |
| 4853 | /* End of Constant: '<S423>/Constant' */ |
| 4854 | /* End of Outputs for SubSystem: '<S493>/ACC1_2A_' */ |
| 4855 | |
| 4856 | /* DataTypeConversion: '<S493>/Data Type Conversion12' */ |
| 4857 | L4_MABX_B.ACCDistanceAlertSignal = L4_MABX_B.SFunction1_o9_jm; |
| 4858 | |
| 4859 | /* DataTypeConversion: '<S493>/Data Type Conversion13' */ |
| 4860 | L4_MABX_B.ForwardCollisionWarning = L4_MABX_B.SFunction1_o10_e; |
| 4861 | |
| 4862 | /* RelationalOperator: '<S478>/Operator' incorporates: |
| 4863 | * Constant: '<S421>/Constant' |
| 4864 | * Constant: '<S476>/Constant' |
| 4865 | */ |
| 4866 | L4_MABX_B.Operator_mo = (L4_MABX_P.Constant_Value_nw == |
| 4867 | L4_MABX_P.Constant_Value_kx); |
| 4868 | |
| 4869 | /* Outputs for Enabled SubSystem: '<S475>/CAN_TYPE1_RX_M1_C1' incorporates: |
| 4870 | * EnablePort: '<S477>/Enable' |
| 4871 | */ |
| 4872 | if (L4_MABX_B.Operator_mo) { |
| 4873 | /* S-Function (rti_commonblock): '<S477>/S-Function1' */ |
| 4874 | /* This comment workarounds a code generation problem */ |
| 4875 | |
| 4876 | /* dSPACE RTICAN RX Message Block: "TPCM_FF_00" Id:485293824 */ |
| 4877 | { |
| 4878 | UInt32 *CAN_Msg; |
| 4879 | static dsfloat time_old = 0.0; |
| 4880 | |
| 4881 | /* Read status and timestamp info (previous message) */ |
| 4882 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CECFF00].timestamp != |
| 4883 | time_old) { |
| 4884 | /* ... save timestamp info for the calculation of the RX status |
| 4885 | during the consecutive sample hit*/ |
| 4886 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CECFF00]. |
| 4887 | timestamp; |
| 4888 | |
| 4889 | /* ... set the processed flag to one */ |
| 4890 | L4_MABX_B.SFunction1_o9_np = 1.0; |
| 4891 | L4_MABX_B.SFunction1_o10_j1 = (real_T) |
| 4892 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CECFF00].timestamp; |
| 4893 | L4_MABX_B.SFunction1_o11_ja = (real_T) |
| 4894 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CECFF00].deltatime; |
| 4895 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CECFF00].data; |
| 4896 | |
| 4897 | /* Decode CAN message */ |
| 4898 | { |
| 4899 | { |
| 4900 | rtican_Signal_t CAN_Sgn; |
| 4901 | |
| 4902 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 4903 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 4904 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4905 | L4_MABX_B.SFunction1_o1_ix = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4906 | |
| 4907 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 4908 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 4909 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4910 | L4_MABX_B.SFunction1_o2_j2 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4911 | |
| 4912 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 4913 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 4914 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4915 | L4_MABX_B.SFunction1_o3_p4p = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4916 | |
| 4917 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 4918 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 4919 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4920 | L4_MABX_B.SFunction1_o4_k2 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4921 | |
| 4922 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 4923 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 4924 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4925 | L4_MABX_B.SFunction1_o5_fy = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4926 | |
| 4927 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 4928 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 4929 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4930 | L4_MABX_B.SFunction1_o6_ii = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4931 | |
| 4932 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 4933 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 4934 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4935 | L4_MABX_B.SFunction1_o7_gj = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4936 | |
| 4937 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 4938 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 4939 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 4940 | L4_MABX_B.SFunction1_o8_fb = ((real_T) CAN_Sgn.UnsignedSgn); |
| 4941 | } |
| 4942 | } |
| 4943 | } else { |
| 4944 | /* set RX status to 0 because no new message has arrived */ |
| 4945 | L4_MABX_B.SFunction1_o9_np = 0.0; |
| 4946 | } |
| 4947 | } |
| 4948 | } |
| 4949 | |
| 4950 | /* End of Outputs for SubSystem: '<S475>/CAN_TYPE1_RX_M1_C1' */ |
| 4951 | |
| 4952 | /* DataTypeConversion: '<S475>/Data Type Conversion' */ |
| 4953 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_ix; |
| 4954 | if (PositionFinalLimited < 256.0) { |
| 4955 | if (PositionFinalLimited >= 0.0) { |
| 4956 | starting_index = (uint8_T)PositionFinalLimited; |
| 4957 | } else { |
| 4958 | starting_index = 0U; |
| 4959 | } |
| 4960 | } else { |
| 4961 | starting_index = MAX_uint8_T; |
| 4962 | } |
| 4963 | |
| 4964 | L4_MABX_B.DataTypeConversion_nz = starting_index; |
| 4965 | |
| 4966 | /* End of DataTypeConversion: '<S475>/Data Type Conversion' */ |
| 4967 | |
| 4968 | /* DataTypeConversion: '<S475>/Data Type Conversion1' */ |
| 4969 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_j2; |
| 4970 | if (PositionFinalLimited < 256.0) { |
| 4971 | if (PositionFinalLimited >= 0.0) { |
| 4972 | starting_index = (uint8_T)PositionFinalLimited; |
| 4973 | } else { |
| 4974 | starting_index = 0U; |
| 4975 | } |
| 4976 | } else { |
| 4977 | starting_index = MAX_uint8_T; |
| 4978 | } |
| 4979 | |
| 4980 | L4_MABX_B.DataTypeConversion1_dy = starting_index; |
| 4981 | |
| 4982 | /* End of DataTypeConversion: '<S475>/Data Type Conversion1' */ |
| 4983 | |
| 4984 | /* DataTypeConversion: '<S475>/Data Type Conversion2' */ |
| 4985 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_p4p; |
| 4986 | if (PositionFinalLimited < 256.0) { |
| 4987 | if (PositionFinalLimited >= 0.0) { |
| 4988 | starting_index = (uint8_T)PositionFinalLimited; |
| 4989 | } else { |
| 4990 | starting_index = 0U; |
| 4991 | } |
| 4992 | } else { |
| 4993 | starting_index = MAX_uint8_T; |
| 4994 | } |
| 4995 | |
| 4996 | L4_MABX_B.DataTypeConversion2_l1 = starting_index; |
| 4997 | |
| 4998 | /* End of DataTypeConversion: '<S475>/Data Type Conversion2' */ |
| 4999 | |
| 5000 | /* DataTypeConversion: '<S475>/Data Type Conversion3' */ |
| 5001 | PositionFinalLimited = L4_MABX_B.SFunction1_o4_k2; |
| 5002 | if (PositionFinalLimited < 256.0) { |
| 5003 | if (PositionFinalLimited >= 0.0) { |
| 5004 | starting_index = (uint8_T)PositionFinalLimited; |
| 5005 | } else { |
| 5006 | starting_index = 0U; |
| 5007 | } |
| 5008 | } else { |
| 5009 | starting_index = MAX_uint8_T; |
| 5010 | } |
| 5011 | |
| 5012 | L4_MABX_B.DataTypeConversion3_lw = starting_index; |
| 5013 | |
| 5014 | /* End of DataTypeConversion: '<S475>/Data Type Conversion3' */ |
| 5015 | |
| 5016 | /* DataTypeConversion: '<S475>/Data Type Conversion4' */ |
| 5017 | PositionFinalLimited = L4_MABX_B.SFunction1_o5_fy; |
| 5018 | if (PositionFinalLimited < 256.0) { |
| 5019 | if (PositionFinalLimited >= 0.0) { |
| 5020 | starting_index = (uint8_T)PositionFinalLimited; |
| 5021 | } else { |
| 5022 | starting_index = 0U; |
| 5023 | } |
| 5024 | } else { |
| 5025 | starting_index = MAX_uint8_T; |
| 5026 | } |
| 5027 | |
| 5028 | L4_MABX_B.DataTypeConversion4_ie = starting_index; |
| 5029 | |
| 5030 | /* End of DataTypeConversion: '<S475>/Data Type Conversion4' */ |
| 5031 | |
| 5032 | /* DataTypeConversion: '<S475>/Data Type Conversion5' */ |
| 5033 | PositionFinalLimited = L4_MABX_B.SFunction1_o6_ii; |
| 5034 | if (PositionFinalLimited < 256.0) { |
| 5035 | if (PositionFinalLimited >= 0.0) { |
| 5036 | starting_index = (uint8_T)PositionFinalLimited; |
| 5037 | } else { |
| 5038 | starting_index = 0U; |
| 5039 | } |
| 5040 | } else { |
| 5041 | starting_index = MAX_uint8_T; |
| 5042 | } |
| 5043 | |
| 5044 | L4_MABX_B.DataTypeConversion5_er = starting_index; |
| 5045 | |
| 5046 | /* End of DataTypeConversion: '<S475>/Data Type Conversion5' */ |
| 5047 | |
| 5048 | /* DataTypeConversion: '<S475>/Data Type Conversion6' */ |
| 5049 | PositionFinalLimited = L4_MABX_B.SFunction1_o7_gj; |
| 5050 | if (PositionFinalLimited < 256.0) { |
| 5051 | if (PositionFinalLimited >= 0.0) { |
| 5052 | starting_index = (uint8_T)PositionFinalLimited; |
| 5053 | } else { |
| 5054 | starting_index = 0U; |
| 5055 | } |
| 5056 | } else { |
| 5057 | starting_index = MAX_uint8_T; |
| 5058 | } |
| 5059 | |
| 5060 | L4_MABX_B.DataTypeConversion6_ml = starting_index; |
| 5061 | |
| 5062 | /* End of DataTypeConversion: '<S475>/Data Type Conversion6' */ |
| 5063 | |
| 5064 | /* DataTypeConversion: '<S475>/Data Type Conversion7' */ |
| 5065 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_fb; |
| 5066 | if (PositionFinalLimited < 256.0) { |
| 5067 | if (PositionFinalLimited >= 0.0) { |
| 5068 | starting_index = (uint8_T)PositionFinalLimited; |
| 5069 | } else { |
| 5070 | starting_index = 0U; |
| 5071 | } |
| 5072 | } else { |
| 5073 | starting_index = MAX_uint8_T; |
| 5074 | } |
| 5075 | |
| 5076 | L4_MABX_B.DataTypeConversion7_f = starting_index; |
| 5077 | |
| 5078 | /* End of DataTypeConversion: '<S475>/Data Type Conversion7' */ |
| 5079 | |
| 5080 | /* MultiPortSwitch: '<S421>/Multiport_Switch' */ |
| 5081 | L4_MABX_B.RawData[0] = L4_MABX_B.DataTypeConversion_nz; |
| 5082 | L4_MABX_B.RawData[1] = L4_MABX_B.DataTypeConversion1_dy; |
| 5083 | L4_MABX_B.RawData[2] = L4_MABX_B.DataTypeConversion2_l1; |
| 5084 | L4_MABX_B.RawData[3] = L4_MABX_B.DataTypeConversion3_lw; |
| 5085 | L4_MABX_B.RawData[4] = L4_MABX_B.DataTypeConversion4_ie; |
| 5086 | L4_MABX_B.RawData[5] = L4_MABX_B.DataTypeConversion5_er; |
| 5087 | L4_MABX_B.RawData[6] = L4_MABX_B.DataTypeConversion6_ml; |
| 5088 | L4_MABX_B.RawData[7] = L4_MABX_B.DataTypeConversion7_f; |
| 5089 | |
| 5090 | /* DataTypeConversion: '<S469>/Data Type Conversion' */ |
| 5091 | for (i = 0; i < 8; i++) { |
| 5092 | L4_MABX_B.DataTypeConversion_jb[i] = L4_MABX_B.RawData[i]; |
| 5093 | } |
| 5094 | |
| 5095 | /* End of DataTypeConversion: '<S469>/Data Type Conversion' */ |
| 5096 | |
| 5097 | /* RelationalOperator: '<S695>/Operator' incorporates: |
| 5098 | * Constant: '<S469>/Constant3' |
| 5099 | */ |
| 5100 | L4_MABX_B.Operator_bl = (L4_MABX_B.DataTypeConversion_jb[0] == |
| 5101 | L4_MABX_P.Constant3_Value_dh); |
| 5102 | |
| 5103 | /* Outputs for Enabled SubSystem: '<S469>/Decode_TPCM_BAM' incorporates: |
| 5104 | * EnablePort: '<S687>/Enable' |
| 5105 | */ |
| 5106 | if (L4_MABX_B.Operator_bl) { |
| 5107 | /* SignalConversion: '<S698>/Signal Conversion' */ |
| 5108 | L4_MABX_B.SPN2556_ControlByte_i = L4_MABX_B.DataTypeConversion_jb[0]; |
| 5109 | |
| 5110 | /* DataTypeConversion: '<S699>/Data Type Conversion' */ |
| 5111 | L4_MABX_B.DataTypeConversion_pr = L4_MABX_B.DataTypeConversion_jb[1]; |
| 5112 | |
| 5113 | /* DataTypeConversion: '<S699>/Data Type Conversion1' */ |
| 5114 | L4_MABX_B.DataTypeConversion1_g3 = L4_MABX_B.DataTypeConversion_jb[2]; |
| 5115 | |
| 5116 | /* ArithShift: '<S699>/Shift Arithmetic2' */ |
| 5117 | L4_MABX_B.ShiftArithmetic2_i = (uint16_T)(L4_MABX_B.DataTypeConversion1_g3 << |
| 5118 | 8); |
| 5119 | |
| 5120 | /* S-Function (sfix_bitop): '<S702>/Operator' */ |
| 5121 | L4_MABX_B.Operator_h5 = (uint16_T)(L4_MABX_B.DataTypeConversion_pr | |
| 5122 | L4_MABX_B.ShiftArithmetic2_i); |
| 5123 | |
| 5124 | /* DataTypeConversion: '<S702>/DataType' */ |
| 5125 | L4_MABX_B.DataType_bh = L4_MABX_B.Operator_h5; |
| 5126 | |
| 5127 | /* SignalConversion: '<S700>/Signal Conversion' */ |
| 5128 | L4_MABX_B.SPN2568_TotalNumberOfPackets = L4_MABX_B.DataTypeConversion_jb[3]; |
| 5129 | |
| 5130 | /* DataTypeConversion: '<S701>/Data Type Conversion' */ |
| 5131 | L4_MABX_B.DataTypeConversion_d = L4_MABX_B.DataTypeConversion_jb[5]; |
| 5132 | |
| 5133 | /* DataTypeConversion: '<S701>/Data Type Conversion1' */ |
| 5134 | L4_MABX_B.DataTypeConversion1_a3 = L4_MABX_B.DataTypeConversion_jb[6]; |
| 5135 | |
| 5136 | /* DataTypeConversion: '<S701>/Data Type Conversion2' */ |
| 5137 | L4_MABX_B.DataTypeConversion2_hx = L4_MABX_B.DataTypeConversion_jb[7]; |
| 5138 | |
| 5139 | /* ArithShift: '<S701>/Shift Arithmetic1' */ |
| 5140 | L4_MABX_B.ShiftArithmetic1_p = L4_MABX_B.DataTypeConversion1_a3 << 8; |
| 5141 | |
| 5142 | /* ArithShift: '<S701>/Shift Arithmetic2' */ |
| 5143 | L4_MABX_B.ShiftArithmetic2_k = L4_MABX_B.DataTypeConversion2_hx << 16; |
| 5144 | |
| 5145 | /* S-Function (sfix_bitop): '<S703>/Operator' */ |
| 5146 | L4_MABX_B.Operator_lu = L4_MABX_B.DataTypeConversion_d | |
| 5147 | L4_MABX_B.ShiftArithmetic1_p | L4_MABX_B.ShiftArithmetic2_k; |
| 5148 | |
| 5149 | /* DataTypeConversion: '<S703>/DataType' */ |
| 5150 | L4_MABX_B.DataType_e3 = L4_MABX_B.Operator_lu; |
| 5151 | } |
| 5152 | |
| 5153 | /* End of Outputs for SubSystem: '<S469>/Decode_TPCM_BAM' */ |
| 5154 | |
| 5155 | /* RelationalOperator: '<S487>/Operator' incorporates: |
| 5156 | * Constant: '<S422>/Constant' |
| 5157 | * Constant: '<S485>/Constant' |
| 5158 | */ |
| 5159 | L4_MABX_B.Operator_cc2 = (L4_MABX_P.Constant_Value_crj == |
| 5160 | L4_MABX_P.Constant_Value_a2); |
| 5161 | |
| 5162 | /* Outputs for Enabled SubSystem: '<S484>/CAN_TYPE1_RX_M1_C1' incorporates: |
| 5163 | * EnablePort: '<S486>/Enable' |
| 5164 | */ |
| 5165 | if (L4_MABX_B.Operator_cc2) { |
| 5166 | /* S-Function (rti_commonblock): '<S486>/S-Function1' */ |
| 5167 | /* This comment workarounds a code generation problem */ |
| 5168 | |
| 5169 | /* dSPACE RTICAN RX Message Block: "TPDT_FF_00" Id:485228288 */ |
| 5170 | { |
| 5171 | UInt32 *CAN_Msg; |
| 5172 | static dsfloat time_old = 0.0; |
| 5173 | |
| 5174 | /* Read status and timestamp info (previous message) */ |
| 5175 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CEBFF00].timestamp != |
| 5176 | time_old) { |
| 5177 | /* ... save timestamp info for the calculation of the RX status |
| 5178 | during the consecutive sample hit*/ |
| 5179 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CEBFF00]. |
| 5180 | timestamp; |
| 5181 | |
| 5182 | /* ... set the processed flag to one */ |
| 5183 | L4_MABX_B.SFunction1_o9_p = 1.0; |
| 5184 | L4_MABX_B.SFunction1_o10_iw = (real_T) |
| 5185 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CEBFF00].timestamp; |
| 5186 | L4_MABX_B.SFunction1_o11_h = (real_T) |
| 5187 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CEBFF00].deltatime; |
| 5188 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CEBFF00].data; |
| 5189 | |
| 5190 | /* Decode CAN message */ |
| 5191 | { |
| 5192 | { |
| 5193 | rtican_Signal_t CAN_Sgn; |
| 5194 | |
| 5195 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 5196 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 5197 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5198 | L4_MABX_B.SFunction1_o1_ok = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5199 | |
| 5200 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 5201 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 5202 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5203 | L4_MABX_B.SFunction1_o2_lo = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5204 | |
| 5205 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 5206 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 5207 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5208 | L4_MABX_B.SFunction1_o3_ps = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5209 | |
| 5210 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 5211 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 5212 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5213 | L4_MABX_B.SFunction1_o4_iz = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5214 | |
| 5215 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 5216 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 5217 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5218 | L4_MABX_B.SFunction1_o5_hi = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5219 | |
| 5220 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 5221 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 5222 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5223 | L4_MABX_B.SFunction1_o6_nx = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5224 | |
| 5225 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 5226 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 5227 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5228 | L4_MABX_B.SFunction1_o7_hn = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5229 | |
| 5230 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 5231 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 5232 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5233 | L4_MABX_B.SFunction1_o8_pn = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5234 | } |
| 5235 | } |
| 5236 | } else { |
| 5237 | /* set RX status to 0 because no new message has arrived */ |
| 5238 | L4_MABX_B.SFunction1_o9_p = 0.0; |
| 5239 | } |
| 5240 | } |
| 5241 | } |
| 5242 | |
| 5243 | /* End of Outputs for SubSystem: '<S484>/CAN_TYPE1_RX_M1_C1' */ |
| 5244 | |
| 5245 | /* DataTypeConversion: '<S484>/Data Type Conversion' */ |
| 5246 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_ok; |
| 5247 | if (PositionFinalLimited < 256.0) { |
| 5248 | if (PositionFinalLimited >= 0.0) { |
| 5249 | starting_index = (uint8_T)PositionFinalLimited; |
| 5250 | } else { |
| 5251 | starting_index = 0U; |
| 5252 | } |
| 5253 | } else { |
| 5254 | starting_index = MAX_uint8_T; |
| 5255 | } |
| 5256 | |
| 5257 | L4_MABX_B.DataTypeConversion_on = starting_index; |
| 5258 | |
| 5259 | /* End of DataTypeConversion: '<S484>/Data Type Conversion' */ |
| 5260 | |
| 5261 | /* DataTypeConversion: '<S484>/Data Type Conversion1' */ |
| 5262 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_lo; |
| 5263 | if (PositionFinalLimited < 256.0) { |
| 5264 | if (PositionFinalLimited >= 0.0) { |
| 5265 | starting_index = (uint8_T)PositionFinalLimited; |
| 5266 | } else { |
| 5267 | starting_index = 0U; |
| 5268 | } |
| 5269 | } else { |
| 5270 | starting_index = MAX_uint8_T; |
| 5271 | } |
| 5272 | |
| 5273 | L4_MABX_B.DataTypeConversion1_ik = starting_index; |
| 5274 | |
| 5275 | /* End of DataTypeConversion: '<S484>/Data Type Conversion1' */ |
| 5276 | |
| 5277 | /* DataTypeConversion: '<S484>/Data Type Conversion2' */ |
| 5278 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_ps; |
| 5279 | if (PositionFinalLimited < 256.0) { |
| 5280 | if (PositionFinalLimited >= 0.0) { |
| 5281 | starting_index = (uint8_T)PositionFinalLimited; |
| 5282 | } else { |
| 5283 | starting_index = 0U; |
| 5284 | } |
| 5285 | } else { |
| 5286 | starting_index = MAX_uint8_T; |
| 5287 | } |
| 5288 | |
| 5289 | L4_MABX_B.DataTypeConversion2_ai = starting_index; |
| 5290 | |
| 5291 | /* End of DataTypeConversion: '<S484>/Data Type Conversion2' */ |
| 5292 | |
| 5293 | /* DataTypeConversion: '<S484>/Data Type Conversion3' */ |
| 5294 | PositionFinalLimited = L4_MABX_B.SFunction1_o4_iz; |
| 5295 | if (PositionFinalLimited < 256.0) { |
| 5296 | if (PositionFinalLimited >= 0.0) { |
| 5297 | starting_index = (uint8_T)PositionFinalLimited; |
| 5298 | } else { |
| 5299 | starting_index = 0U; |
| 5300 | } |
| 5301 | } else { |
| 5302 | starting_index = MAX_uint8_T; |
| 5303 | } |
| 5304 | |
| 5305 | L4_MABX_B.DataTypeConversion3_c1 = starting_index; |
| 5306 | |
| 5307 | /* End of DataTypeConversion: '<S484>/Data Type Conversion3' */ |
| 5308 | |
| 5309 | /* DataTypeConversion: '<S484>/Data Type Conversion4' */ |
| 5310 | PositionFinalLimited = L4_MABX_B.SFunction1_o5_hi; |
| 5311 | if (PositionFinalLimited < 256.0) { |
| 5312 | if (PositionFinalLimited >= 0.0) { |
| 5313 | starting_index = (uint8_T)PositionFinalLimited; |
| 5314 | } else { |
| 5315 | starting_index = 0U; |
| 5316 | } |
| 5317 | } else { |
| 5318 | starting_index = MAX_uint8_T; |
| 5319 | } |
| 5320 | |
| 5321 | L4_MABX_B.DataTypeConversion4_ci = starting_index; |
| 5322 | |
| 5323 | /* End of DataTypeConversion: '<S484>/Data Type Conversion4' */ |
| 5324 | |
| 5325 | /* DataTypeConversion: '<S484>/Data Type Conversion5' */ |
| 5326 | PositionFinalLimited = L4_MABX_B.SFunction1_o6_nx; |
| 5327 | if (PositionFinalLimited < 256.0) { |
| 5328 | if (PositionFinalLimited >= 0.0) { |
| 5329 | starting_index = (uint8_T)PositionFinalLimited; |
| 5330 | } else { |
| 5331 | starting_index = 0U; |
| 5332 | } |
| 5333 | } else { |
| 5334 | starting_index = MAX_uint8_T; |
| 5335 | } |
| 5336 | |
| 5337 | L4_MABX_B.DataTypeConversion5_a = starting_index; |
| 5338 | |
| 5339 | /* End of DataTypeConversion: '<S484>/Data Type Conversion5' */ |
| 5340 | |
| 5341 | /* DataTypeConversion: '<S484>/Data Type Conversion6' */ |
| 5342 | PositionFinalLimited = L4_MABX_B.SFunction1_o7_hn; |
| 5343 | if (PositionFinalLimited < 256.0) { |
| 5344 | if (PositionFinalLimited >= 0.0) { |
| 5345 | starting_index = (uint8_T)PositionFinalLimited; |
| 5346 | } else { |
| 5347 | starting_index = 0U; |
| 5348 | } |
| 5349 | } else { |
| 5350 | starting_index = MAX_uint8_T; |
| 5351 | } |
| 5352 | |
| 5353 | L4_MABX_B.DataTypeConversion6_m1 = starting_index; |
| 5354 | |
| 5355 | /* End of DataTypeConversion: '<S484>/Data Type Conversion6' */ |
| 5356 | |
| 5357 | /* DataTypeConversion: '<S484>/Data Type Conversion7' */ |
| 5358 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_pn; |
| 5359 | if (PositionFinalLimited < 256.0) { |
| 5360 | if (PositionFinalLimited >= 0.0) { |
| 5361 | starting_index = (uint8_T)PositionFinalLimited; |
| 5362 | } else { |
| 5363 | starting_index = 0U; |
| 5364 | } |
| 5365 | } else { |
| 5366 | starting_index = MAX_uint8_T; |
| 5367 | } |
| 5368 | |
| 5369 | L4_MABX_B.DataTypeConversion7_oj = starting_index; |
| 5370 | |
| 5371 | /* End of DataTypeConversion: '<S484>/Data Type Conversion7' */ |
| 5372 | |
| 5373 | /* MultiPortSwitch: '<S422>/Multiport_Switch' */ |
| 5374 | L4_MABX_B.RawData_o[0] = L4_MABX_B.DataTypeConversion_on; |
| 5375 | L4_MABX_B.RawData_o[1] = L4_MABX_B.DataTypeConversion1_ik; |
| 5376 | L4_MABX_B.RawData_o[2] = L4_MABX_B.DataTypeConversion2_ai; |
| 5377 | L4_MABX_B.RawData_o[3] = L4_MABX_B.DataTypeConversion3_c1; |
| 5378 | L4_MABX_B.RawData_o[4] = L4_MABX_B.DataTypeConversion4_ci; |
| 5379 | L4_MABX_B.RawData_o[5] = L4_MABX_B.DataTypeConversion5_a; |
| 5380 | L4_MABX_B.RawData_o[6] = L4_MABX_B.DataTypeConversion6_m1; |
| 5381 | L4_MABX_B.RawData_o[7] = L4_MABX_B.DataTypeConversion7_oj; |
| 5382 | |
| 5383 | /* DataTypeConversion: '<S470>/Data Type Conversion' */ |
| 5384 | for (i = 0; i < 8; i++) { |
| 5385 | L4_MABX_B.DataTypeConversion_eh[i] = L4_MABX_B.RawData_o[i]; |
| 5386 | } |
| 5387 | |
| 5388 | /* End of DataTypeConversion: '<S470>/Data Type Conversion' */ |
| 5389 | |
| 5390 | /* S-Function (rti_commonblock): '<S848>/S-Function1' */ |
| 5391 | |
| 5392 | /* This comment workarounds a code generation problem */ |
| 5393 | |
| 5394 | /* End of Outputs for S-Function (rti_commonblock): '<S848>/S-Function1' */ |
| 5395 | |
| 5396 | /* RateTransition: '<S417>/Rate Transition' */ |
| 5397 | switch (L4_MABX_DW.RateTransition_write_buf) { |
| 5398 | case 0: |
| 5399 | L4_MABX_DW.RateTransition_read_buf = 1; |
| 5400 | break; |
| 5401 | |
| 5402 | case 1: |
| 5403 | L4_MABX_DW.RateTransition_read_buf = 0; |
| 5404 | break; |
| 5405 | |
| 5406 | default: |
| 5407 | L4_MABX_DW.RateTransition_read_buf = L4_MABX_DW.RateTransition_last_buf_wr; |
| 5408 | break; |
| 5409 | } |
| 5410 | |
| 5411 | if (L4_MABX_DW.RateTransition_read_buf != 0) { |
| 5412 | GLB_Absolute_Timestamp = L4_MABX_DW.RateTransition_Buffer1; |
| 5413 | } else { |
| 5414 | GLB_Absolute_Timestamp = L4_MABX_DW.RateTransition_Buffer0; |
| 5415 | } |
| 5416 | |
| 5417 | L4_MABX_DW.RateTransition_read_buf = -1; |
| 5418 | |
| 5419 | /* End of RateTransition: '<S417>/Rate Transition' */ |
| 5420 | |
| 5421 | /* DataTypeConversion: '<S484>/Data Type Conversion8' */ |
| 5422 | L4_MABX_B.RX_status = (L4_MABX_B.SFunction1_o9_p != 0.0); |
| 5423 | |
| 5424 | /* MultiPortSwitch: '<S422>/Multiport_Switch' */ |
| 5425 | L4_MABX_B.RX_status_n = L4_MABX_B.RX_status; |
| 5426 | |
| 5427 | /* RelationalOperator: '<S522>/Operator' incorporates: |
| 5428 | * Constant: '<S436>/Constant2' |
| 5429 | */ |
| 5430 | L4_MABX_B.Operator_fj = (L4_MABX_B.DataType_e3 == L4_MABX_P.Constant2_Value_l); |
| 5431 | |
| 5432 | /* Logic: '<S436>/Logical Operator' */ |
| 5433 | L4_MABX_B.LogicalOperator_n = (L4_MABX_B.RX_status_n && L4_MABX_B.Operator_fj); |
| 5434 | |
| 5435 | /* Outputs for Enabled SubSystem: '<S436>/CAN_RX_EC1_00' incorporates: |
| 5436 | * EnablePort: '<S520>/Enable' |
| 5437 | */ |
| 5438 | if (L4_MABX_B.LogicalOperator_n) { |
| 5439 | /* UnitDelay: '<S520>/Unit Delay' */ |
| 5440 | for (i = 0; i < 39; i++) { |
| 5441 | L4_MABX_B.UnitDelay_j1[i] = L4_MABX_DW.UnitDelay_DSTATE_l[i]; |
| 5442 | } |
| 5443 | |
| 5444 | /* End of UnitDelay: '<S520>/Unit Delay' */ |
| 5445 | |
| 5446 | /* MATLAB Function: '<S520>/serialize_tpdt' */ |
| 5447 | /* MATLAB Function 'INPUTS_PIC_KW/CAN_PIC_KW/CAN_RX_EC1_00/CAN_RX_EC1_00/serialize_tpdt': '<S524>:1' */ |
| 5448 | /* '<S524>:1:9' */ |
| 5449 | if (L4_MABX_B.DataTypeConversion_eh[0] > 1) { |
| 5450 | /* '<S524>:1:6' */ |
| 5451 | /* '<S524>:1:7' */ |
| 5452 | for (i = 0; i < 39; i++) { |
| 5453 | L4_MABX_B.Data_d[i] = L4_MABX_B.UnitDelay_j1[i]; |
| 5454 | } |
| 5455 | } else { |
| 5456 | /* '<S524>:1:9' */ |
| 5457 | for (i = 0; i < 39; i++) { |
| 5458 | L4_MABX_B.Data_d[i] = MAX_uint8_T; |
| 5459 | } |
| 5460 | } |
| 5461 | |
| 5462 | /* '<S524>:1:11' */ |
| 5463 | i = (int32_T)(7U * L4_MABX_B.DataTypeConversion_eh[0]); |
| 5464 | if ((uint32_T)i > 255U) { |
| 5465 | i = 255; |
| 5466 | } |
| 5467 | |
| 5468 | tmp = i - 6U; |
| 5469 | if (tmp > (uint32_T)i) { |
| 5470 | tmp = 0U; |
| 5471 | } |
| 5472 | |
| 5473 | i = (int32_T)tmp; |
| 5474 | starting_index = (uint8_T)i; |
| 5475 | |
| 5476 | /* '<S524>:1:12' */ |
| 5477 | L4_MABX_B.Data_d[starting_index - 1] = L4_MABX_B.DataTypeConversion_eh[1]; |
| 5478 | L4_MABX_B.Data_d[starting_index] = L4_MABX_B.DataTypeConversion_eh[2]; |
| 5479 | L4_MABX_B.Data_d[starting_index + 1] = L4_MABX_B.DataTypeConversion_eh[3]; |
| 5480 | L4_MABX_B.Data_d[starting_index + 2] = L4_MABX_B.DataTypeConversion_eh[4]; |
| 5481 | L4_MABX_B.Data_d[starting_index + 3] = L4_MABX_B.DataTypeConversion_eh[5]; |
| 5482 | L4_MABX_B.Data_d[starting_index + 4] = L4_MABX_B.DataTypeConversion_eh[6]; |
| 5483 | L4_MABX_B.Data_d[starting_index + 5] = L4_MABX_B.DataTypeConversion_eh[7]; |
| 5484 | |
| 5485 | /* '<S524>:1:13' */ |
| 5486 | L4_MABX_B.RX_status_kj = (L4_MABX_B.DataTypeConversion_eh[0] == |
| 5487 | L4_MABX_B.SPN2568_TotalNumberOfPackets); |
| 5488 | |
| 5489 | /* End of MATLAB Function: '<S520>/serialize_tpdt' */ |
| 5490 | |
| 5491 | /* Outputs for Enabled SubSystem: '<S520>/Decode' incorporates: |
| 5492 | * EnablePort: '<S523>/Enable' |
| 5493 | */ |
| 5494 | if (L4_MABX_B.RX_status_kj) { |
| 5495 | /* Inport: '<S523>/Inport' */ |
| 5496 | for (i = 0; i < 39; i++) { |
| 5497 | L4_MABX_B.Inport_g[i] = L4_MABX_B.Data_d[i]; |
| 5498 | } |
| 5499 | |
| 5500 | /* End of Inport: '<S523>/Inport' */ |
| 5501 | |
| 5502 | /* Inport: '<S523>/timeStamp' */ |
| 5503 | L4_MABX_B.timeStamp_o = GLB_Absolute_Timestamp; |
| 5504 | |
| 5505 | /* UnitDelay: '<S523>/Unit_Delay' */ |
| 5506 | L4_MABX_B.Unit_Delay_m = L4_MABX_DW.Unit_Delay_DSTATE_lq; |
| 5507 | |
| 5508 | /* Sum: '<S523>/Subtract' */ |
| 5509 | L4_MABX_B.Subtract_k0 = (real32_T)(L4_MABX_B.timeStamp_o - |
| 5510 | L4_MABX_B.Unit_Delay_m); |
| 5511 | } |
| 5512 | |
| 5513 | /* End of Outputs for SubSystem: '<S520>/Decode' */ |
| 5514 | } |
| 5515 | |
| 5516 | /* End of Outputs for SubSystem: '<S436>/CAN_RX_EC1_00' */ |
| 5517 | |
| 5518 | /* DataTypeConversion: '<S521>/Data Type Conversion' */ |
| 5519 | for (i = 0; i < 39; i++) { |
| 5520 | L4_MABX_B.DataTypeConversion_go[i] = L4_MABX_B.Inport_g[i]; |
| 5521 | } |
| 5522 | |
| 5523 | /* End of DataTypeConversion: '<S521>/Data Type Conversion' */ |
| 5524 | |
| 5525 | /* DataTypeConversion: '<S532>/Data Type Conversion' */ |
| 5526 | L4_MABX_B.DataTypeConversion_jj = L4_MABX_B.DataTypeConversion_go[19]; |
| 5527 | |
| 5528 | /* DataTypeConversion: '<S532>/Data Type Conversion1' */ |
| 5529 | L4_MABX_B.DataTypeConversion1_pr = L4_MABX_B.DataTypeConversion_go[20]; |
| 5530 | |
| 5531 | /* ArithShift: '<S532>/Shift Arithmetic' */ |
| 5532 | L4_MABX_B.ShiftArithmetic = (uint16_T)(L4_MABX_B.DataTypeConversion1_pr << 8); |
| 5533 | |
| 5534 | /* S-Function (sfix_bitop): '<S557>/Operator' */ |
| 5535 | L4_MABX_B.Operator_ke = (uint16_T)(L4_MABX_B.DataTypeConversion_jj | |
| 5536 | L4_MABX_B.ShiftArithmetic); |
| 5537 | |
| 5538 | /* DataTypeConversion: '<S557>/DataType' */ |
| 5539 | L4_MABX_B.DataType_ad = L4_MABX_B.Operator_ke; |
| 5540 | |
| 5541 | /* DataTypeConversion: '<S532>/Data Type Conversion2' */ |
| 5542 | L4_MABX_B.SPN544_EngineReferenceTorque = L4_MABX_B.DataType_ad; |
| 5543 | |
| 5544 | /* Outputs for Enabled SubSystem: '<S642>/VDC1_0B_' incorporates: |
| 5545 | * EnablePort: '<S643>/Enable' |
| 5546 | */ |
| 5547 | /* Constant: '<S456>/Constant' */ |
| 5548 | if (L4_MABX_P.Constant_Value_io2) { |
| 5549 | /* S-Function (rti_commonblock): '<S643>/S-Function1' */ |
| 5550 | /* This comment workarounds a code generation problem */ |
| 5551 | |
| 5552 | /* dSPACE RTICAN RX Message Block: "VDC1_0B" Id:419319563 */ |
| 5553 | { |
| 5554 | UInt32 *CAN_Msg; |
| 5555 | static dsfloat time_old = 0.0; |
| 5556 | |
| 5557 | /* Read status and timestamp info (previous message) */ |
| 5558 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE4F0B].timestamp != |
| 5559 | time_old) { |
| 5560 | /* ... save timestamp info for the calculation of the RX status |
| 5561 | during the consecutive sample hit*/ |
| 5562 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE4F0B]. |
| 5563 | timestamp; |
| 5564 | |
| 5565 | /* ... set the processed flag to one */ |
| 5566 | L4_MABX_B.SFunction1_o8_b = 1.0; |
| 5567 | L4_MABX_B.SFunction1_o9_g = (real_T) |
| 5568 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE4F0B].timestamp; |
| 5569 | L4_MABX_B.SFunction1_o10 = (real_T) |
| 5570 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE4F0B].deltatime; |
| 5571 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE4F0B].data; |
| 5572 | |
| 5573 | /* Decode CAN message */ |
| 5574 | { |
| 5575 | { |
| 5576 | rtican_Signal_t CAN_Sgn; |
| 5577 | |
| 5578 | /* ...... "VDCInformationSignal" (0|2, standard signal, unsigned int, little endian) */ |
| 5579 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 5580 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5581 | L4_MABX_B.SFunction1_o1_n1 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5582 | |
| 5583 | /* ...... "VDCFullyOperational" (2|2, standard signal, unsigned int, little endian) */ |
| 5584 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 5585 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 5586 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5587 | L4_MABX_B.SFunction1_o2_j = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5588 | |
| 5589 | /* ...... "VDCBrakeLightRq" (4|2, standard signal, unsigned int, little endian) */ |
| 5590 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 5591 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 5592 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5593 | L4_MABX_B.SFunction1_o3_pa = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5594 | |
| 5595 | /* ...... "ROPEngCtrlActive" (8|2, standard signal, unsigned int, little endian) */ |
| 5596 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 5597 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5598 | L4_MABX_B.SFunction1_o4_bm = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5599 | |
| 5600 | /* ...... "ROPBrakeCtrlActive" (10|2, standard signal, unsigned int, little endian) */ |
| 5601 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 5602 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 5603 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5604 | L4_MABX_B.SFunction1_o5_b = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5605 | |
| 5606 | /* ...... "YCEngCtrlActive" (12|2, standard signal, unsigned int, little endian) */ |
| 5607 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 5608 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 5609 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5610 | L4_MABX_B.SFunction1_o6_e = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5611 | |
| 5612 | /* ...... "YCBrakeCtrlActive" (14|2, standard signal, unsigned int, little endian) */ |
| 5613 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 5614 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 5615 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5616 | L4_MABX_B.SFunction1_o7_a = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5617 | } |
| 5618 | } |
| 5619 | } else { |
| 5620 | /* set RX status to 0 because no new message has arrived */ |
| 5621 | L4_MABX_B.SFunction1_o8_b = 0.0; |
| 5622 | } |
| 5623 | } |
| 5624 | } |
| 5625 | |
| 5626 | /* End of Constant: '<S456>/Constant' */ |
| 5627 | /* End of Outputs for SubSystem: '<S642>/VDC1_0B_' */ |
| 5628 | |
| 5629 | /* Outputs for Enabled SubSystem: '<S644>/VDC2_0B1' incorporates: |
| 5630 | * EnablePort: '<S645>/Enable' |
| 5631 | */ |
| 5632 | /* Constant: '<S457>/Constant' */ |
| 5633 | if (L4_MABX_P.Constant_Value_cm) { |
| 5634 | /* S-Function (rti_commonblock): '<S645>/S-Function1' */ |
| 5635 | /* This comment workarounds a code generation problem */ |
| 5636 | |
| 5637 | /* dSPACE RTICAN RX Message Block: "VDC2_0B" Id:418384139 */ |
| 5638 | { |
| 5639 | UInt32 *CAN_Msg; |
| 5640 | static dsfloat time_old = 0.0; |
| 5641 | |
| 5642 | /* Read status and timestamp info (previous message) */ |
| 5643 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0090B].timestamp != |
| 5644 | time_old) { |
| 5645 | /* ... save timestamp info for the calculation of the RX status |
| 5646 | during the consecutive sample hit*/ |
| 5647 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0090B]. |
| 5648 | timestamp; |
| 5649 | |
| 5650 | /* ... set the processed flag to one */ |
| 5651 | L4_MABX_B.SFunction1_o7_c = 1.0; |
| 5652 | L4_MABX_B.SFunction1_o8_d = (real_T) |
| 5653 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0090B].timestamp; |
| 5654 | L4_MABX_B.SFunction1_o9 = (real_T) |
| 5655 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0090B].deltatime; |
| 5656 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0090B].data; |
| 5657 | |
| 5658 | /* Decode CAN message */ |
| 5659 | { |
| 5660 | { |
| 5661 | rtican_Signal_t CAN_Sgn; |
| 5662 | |
| 5663 | /* ...... "SteerWheelAngle" (0|16, standard signal, unsigned int, little endian) */ |
| 5664 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 5665 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 5666 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 5667 | SteerWheelAngle = -31.374 + ( 0.0009765625 * ( ((real_T) |
| 5668 | CAN_Sgn.UnsignedSgn) ) ); |
| 5669 | |
| 5670 | /* ...... "SteerWheelTurnCounter" (16|6, standard signal, unsigned int, little endian) */ |
| 5671 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 5672 | CAN_Sgn.UnsignedSgn &= 0x0000003F; |
| 5673 | L4_MABX_B.SFunction1_o2_gl = -32 + ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 5674 | |
| 5675 | /* ...... "SteerWheelAngleSensorType" (22|2, standard signal, unsigned int, little endian) */ |
| 5676 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 5677 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 5678 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5679 | L4_MABX_B.SFunction1_o3_gw = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5680 | |
| 5681 | /* ...... "YawRate" (24|16, standard signal, unsigned int, little endian) */ |
| 5682 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 5683 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 5684 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 5685 | YawRate = -3.92 + ( 0.0001220703125 * ( ((real_T) |
| 5686 | CAN_Sgn.UnsignedSgn) ) ); |
| 5687 | |
| 5688 | /* ...... "LateralAcceleration" (40|16, standard signal, unsigned int, little endian) */ |
| 5689 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 5690 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 5691 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 5692 | L4_MABX_B.SFunction1_o5_d = -15.687 + ( 0.00048828125 * ( ((real_T) |
| 5693 | CAN_Sgn.UnsignedSgn) ) ); |
| 5694 | |
| 5695 | /* ...... "LongitudinalAcceleration" (56|8, standard signal, unsigned int, little endian) */ |
| 5696 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 5697 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 5698 | SPN1810_LongitudinalAcceleration = -12.5 + ( 0.1 * ( ((real_T) |
| 5699 | CAN_Sgn.UnsignedSgn) ) ); |
| 5700 | } |
| 5701 | } |
| 5702 | } else { |
| 5703 | /* set RX status to 0 because no new message has arrived */ |
| 5704 | L4_MABX_B.SFunction1_o7_c = 0.0; |
| 5705 | } |
| 5706 | } |
| 5707 | } |
| 5708 | |
| 5709 | /* End of Constant: '<S457>/Constant' */ |
| 5710 | /* End of Outputs for SubSystem: '<S644>/VDC2_0B1' */ |
| 5711 | |
| 5712 | /* UnitDelay: '<S649>/Unit_Delay3' */ |
| 5713 | L4_MABX_B.Unit_Delay3 = L4_MABX_DW.Unit_Delay3_DSTATE; |
| 5714 | |
| 5715 | /* RelationalOperator: '<S650>/Operator' incorporates: |
| 5716 | * Constant: '<S459>/Constant2' |
| 5717 | */ |
| 5718 | L4_MABX_B.Operator_dk = (L4_MABX_B.DataType_e3 == L4_MABX_P.Constant2_Value_py); |
| 5719 | |
| 5720 | /* Logic: '<S459>/Logical Operator' */ |
| 5721 | L4_MABX_B.LogicalOperator_ne = (L4_MABX_B.RX_status_n && L4_MABX_B.Operator_dk); |
| 5722 | |
| 5723 | /* Outputs for Enabled SubSystem: '<S459>/CAN_RX_VI_00' incorporates: |
| 5724 | * EnablePort: '<S648>/Enable' |
| 5725 | */ |
| 5726 | if (L4_MABX_B.LogicalOperator_ne) { |
| 5727 | /* UnitDelay: '<S648>/Unit Delay' */ |
| 5728 | for (i = 0; i < 17; i++) { |
| 5729 | L4_MABX_B.UnitDelay_l1[i] = L4_MABX_DW.UnitDelay_DSTATE_bh[i]; |
| 5730 | } |
| 5731 | |
| 5732 | /* End of UnitDelay: '<S648>/Unit Delay' */ |
| 5733 | |
| 5734 | /* MATLAB Function: '<S648>/serialize_tpdt' */ |
| 5735 | /* MATLAB Function 'INPUTS_PIC_KW/CAN_PIC_KW/CAN_RX_VI_00/CAN_RX_VI_00/serialize_tpdt': '<S652>:1' */ |
| 5736 | /* '<S652>:1:9' */ |
| 5737 | if (L4_MABX_B.DataTypeConversion_eh[0] > 1) { |
| 5738 | /* '<S652>:1:6' */ |
| 5739 | /* '<S652>:1:7' */ |
| 5740 | for (i = 0; i < 17; i++) { |
| 5741 | L4_MABX_B.Data[i] = L4_MABX_B.UnitDelay_l1[i]; |
| 5742 | } |
| 5743 | } else { |
| 5744 | /* '<S652>:1:9' */ |
| 5745 | for (i = 0; i < 17; i++) { |
| 5746 | L4_MABX_B.Data[i] = MAX_uint8_T; |
| 5747 | } |
| 5748 | } |
| 5749 | |
| 5750 | /* '<S652>:1:11' */ |
| 5751 | i = (int32_T)(7U * L4_MABX_B.DataTypeConversion_eh[0]); |
| 5752 | if ((uint32_T)i > 255U) { |
| 5753 | i = 255; |
| 5754 | } |
| 5755 | |
| 5756 | tmp = i - 6U; |
| 5757 | if (tmp > (uint32_T)i) { |
| 5758 | tmp = 0U; |
| 5759 | } |
| 5760 | |
| 5761 | i = (int32_T)tmp; |
| 5762 | starting_index = (uint8_T)i; |
| 5763 | |
| 5764 | /* '<S652>:1:12' */ |
| 5765 | L4_MABX_B.Data[starting_index - 1] = L4_MABX_B.DataTypeConversion_eh[1]; |
| 5766 | L4_MABX_B.Data[starting_index] = L4_MABX_B.DataTypeConversion_eh[2]; |
| 5767 | L4_MABX_B.Data[starting_index + 1] = L4_MABX_B.DataTypeConversion_eh[3]; |
| 5768 | L4_MABX_B.Data[starting_index + 2] = L4_MABX_B.DataTypeConversion_eh[4]; |
| 5769 | L4_MABX_B.Data[starting_index + 3] = L4_MABX_B.DataTypeConversion_eh[5]; |
| 5770 | L4_MABX_B.Data[starting_index + 4] = L4_MABX_B.DataTypeConversion_eh[6]; |
| 5771 | L4_MABX_B.Data[starting_index + 5] = L4_MABX_B.DataTypeConversion_eh[7]; |
| 5772 | |
| 5773 | /* '<S652>:1:13' */ |
| 5774 | L4_MABX_B.RX_status_dx = (L4_MABX_B.DataTypeConversion_eh[0] == |
| 5775 | L4_MABX_B.SPN2568_TotalNumberOfPackets); |
| 5776 | |
| 5777 | /* End of MATLAB Function: '<S648>/serialize_tpdt' */ |
| 5778 | |
| 5779 | /* Outputs for Enabled SubSystem: '<S648>/Decode' incorporates: |
| 5780 | * EnablePort: '<S651>/Enable' |
| 5781 | */ |
| 5782 | if (L4_MABX_B.RX_status_dx) { |
| 5783 | /* Inport: '<S651>/Inport' */ |
| 5784 | for (i = 0; i < 17; i++) { |
| 5785 | L4_MABX_B.Inport[i] = L4_MABX_B.Data[i]; |
| 5786 | } |
| 5787 | |
| 5788 | /* End of Inport: '<S651>/Inport' */ |
| 5789 | |
| 5790 | /* Inport: '<S651>/timeStamp' */ |
| 5791 | L4_MABX_B.timeStamp = GLB_Absolute_Timestamp; |
| 5792 | |
| 5793 | /* UnitDelay: '<S651>/Unit_Delay' */ |
| 5794 | L4_MABX_B.Unit_Delay_b = L4_MABX_DW.Unit_Delay_DSTATE_f; |
| 5795 | |
| 5796 | /* Sum: '<S651>/Subtract' */ |
| 5797 | L4_MABX_B.Subtract_bm = (real32_T)(L4_MABX_B.timeStamp - |
| 5798 | L4_MABX_B.Unit_Delay_b); |
| 5799 | } |
| 5800 | |
| 5801 | /* End of Outputs for SubSystem: '<S648>/Decode' */ |
| 5802 | } |
| 5803 | |
| 5804 | /* End of Outputs for SubSystem: '<S459>/CAN_RX_VI_00' */ |
| 5805 | |
| 5806 | /* DataTypeConversion: '<S649>/Data Type Conversion' */ |
| 5807 | L4_MABX_B.DataTypeConversion_c4 = L4_MABX_B.Inport[0]; |
| 5808 | |
| 5809 | /* DataTypeConversion: '<S649>/Data Type Conversion1' */ |
| 5810 | L4_MABX_B.DataTypeConversion1_er = L4_MABX_B.Inport[1]; |
| 5811 | |
| 5812 | /* DataTypeConversion: '<S649>/Data Type Conversion2' */ |
| 5813 | L4_MABX_B.DataTypeConversion2_nx = L4_MABX_B.Inport[2]; |
| 5814 | |
| 5815 | /* DataTypeConversion: '<S649>/Data Type Conversion3' */ |
| 5816 | L4_MABX_B.DataTypeConversion3_b = L4_MABX_B.Inport[3]; |
| 5817 | |
| 5818 | /* DataTypeConversion: '<S649>/Data Type Conversion4' */ |
| 5819 | L4_MABX_B.DataTypeConversion4_d = L4_MABX_B.Inport[4]; |
| 5820 | |
| 5821 | /* DataTypeConversion: '<S649>/Data Type Conversion5' */ |
| 5822 | L4_MABX_B.DataTypeConversion5_iu = L4_MABX_B.Inport[5]; |
| 5823 | |
| 5824 | /* DataTypeConversion: '<S649>/Data Type Conversion6' */ |
| 5825 | L4_MABX_B.DataTypeConversion6_d = L4_MABX_B.Inport[6]; |
| 5826 | |
| 5827 | /* DataTypeConversion: '<S649>/Data Type Conversion7' */ |
| 5828 | L4_MABX_B.DataTypeConversion7_ma = L4_MABX_B.Inport[7]; |
| 5829 | |
| 5830 | /* DataTypeConversion: '<S649>/Data Type Conversion8' */ |
| 5831 | L4_MABX_B.DataTypeConversion8_bt = L4_MABX_B.Inport[8]; |
| 5832 | |
| 5833 | /* DataTypeConversion: '<S649>/Data Type Conversion9' */ |
| 5834 | L4_MABX_B.DataTypeConversion9_c = L4_MABX_B.Inport[9]; |
| 5835 | |
| 5836 | /* DataTypeConversion: '<S649>/Data Type Conversion10' */ |
| 5837 | L4_MABX_B.DataTypeConversion10_b = L4_MABX_B.Inport[10]; |
| 5838 | |
| 5839 | /* DataTypeConversion: '<S649>/Data Type Conversion11' */ |
| 5840 | L4_MABX_B.DataTypeConversion11_i = L4_MABX_B.Inport[11]; |
| 5841 | |
| 5842 | /* DataTypeConversion: '<S649>/Data Type Conversion12' */ |
| 5843 | L4_MABX_B.DataTypeConversion12 = L4_MABX_B.Inport[12]; |
| 5844 | |
| 5845 | /* DataTypeConversion: '<S649>/Data Type Conversion14' */ |
| 5846 | L4_MABX_B.DataTypeConversion14_l = L4_MABX_B.Inport[13]; |
| 5847 | |
| 5848 | /* DataTypeConversion: '<S649>/Data Type Conversion13' */ |
| 5849 | L4_MABX_B.DataTypeConversion13_k = L4_MABX_B.Inport[14]; |
| 5850 | |
| 5851 | /* DataTypeConversion: '<S649>/Data Type Conversion15' */ |
| 5852 | L4_MABX_B.DataTypeConversion15_d = L4_MABX_B.Inport[15]; |
| 5853 | |
| 5854 | /* DataTypeConversion: '<S649>/Data Type Conversion16' */ |
| 5855 | L4_MABX_B.DataTypeConversion16_j = L4_MABX_B.Inport[16]; |
| 5856 | |
| 5857 | /* RelationalOperator: '<S649>/Relational Operator1' incorporates: |
| 5858 | * Constant: '<S649>/TRUCK_1571_VIN_CPV' |
| 5859 | */ |
| 5860 | L4_MABX_B.RelationalOperator1_k[0] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[0] != |
| 5861 | L4_MABX_B.DataTypeConversion_c4); |
| 5862 | L4_MABX_B.RelationalOperator1_k[1] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[1] != |
| 5863 | L4_MABX_B.DataTypeConversion1_er); |
| 5864 | L4_MABX_B.RelationalOperator1_k[2] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[2] != |
| 5865 | L4_MABX_B.DataTypeConversion2_nx); |
| 5866 | L4_MABX_B.RelationalOperator1_k[3] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[3] != |
| 5867 | L4_MABX_B.DataTypeConversion3_b); |
| 5868 | L4_MABX_B.RelationalOperator1_k[4] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[4] != |
| 5869 | L4_MABX_B.DataTypeConversion4_d); |
| 5870 | L4_MABX_B.RelationalOperator1_k[5] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[5] != |
| 5871 | L4_MABX_B.DataTypeConversion5_iu); |
| 5872 | L4_MABX_B.RelationalOperator1_k[6] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[6] != |
| 5873 | L4_MABX_B.DataTypeConversion6_d); |
| 5874 | L4_MABX_B.RelationalOperator1_k[7] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[7] != |
| 5875 | L4_MABX_B.DataTypeConversion7_ma); |
| 5876 | L4_MABX_B.RelationalOperator1_k[8] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[8] != |
| 5877 | L4_MABX_B.DataTypeConversion8_bt); |
| 5878 | L4_MABX_B.RelationalOperator1_k[9] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[9] != |
| 5879 | L4_MABX_B.DataTypeConversion9_c); |
| 5880 | L4_MABX_B.RelationalOperator1_k[10] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[10] |
| 5881 | != L4_MABX_B.DataTypeConversion10_b); |
| 5882 | L4_MABX_B.RelationalOperator1_k[11] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[11] |
| 5883 | != L4_MABX_B.DataTypeConversion11_i); |
| 5884 | L4_MABX_B.RelationalOperator1_k[12] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[12] |
| 5885 | != L4_MABX_B.DataTypeConversion12); |
| 5886 | L4_MABX_B.RelationalOperator1_k[13] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[13] |
| 5887 | != L4_MABX_B.DataTypeConversion14_l); |
| 5888 | L4_MABX_B.RelationalOperator1_k[14] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[14] |
| 5889 | != L4_MABX_B.DataTypeConversion13_k); |
| 5890 | L4_MABX_B.RelationalOperator1_k[15] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[15] |
| 5891 | != L4_MABX_B.DataTypeConversion15_d); |
| 5892 | L4_MABX_B.RelationalOperator1_k[16] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[16] |
| 5893 | != L4_MABX_B.DataTypeConversion16_j); |
| 5894 | |
| 5895 | /* Sum: '<S649>/Add' */ |
| 5896 | tmp = 0U; |
| 5897 | for (i = 0; i < 17; i++) { |
| 5898 | tmp += L4_MABX_B.RelationalOperator1_k[i]; |
| 5899 | } |
| 5900 | |
| 5901 | L4_MABX_B.Add_o1 = (uint8_T)tmp; |
| 5902 | |
| 5903 | /* End of Sum: '<S649>/Add' */ |
| 5904 | |
| 5905 | /* RelationalOperator: '<S653>/Compare' incorporates: |
| 5906 | * Constant: '<S653>/Constant' |
| 5907 | */ |
| 5908 | L4_MABX_B.Compare_c1 = (L4_MABX_B.Add_o1 == L4_MABX_P.Constant_Value_hj); |
| 5909 | |
| 5910 | /* Logic: '<S649>/Logical Operator' */ |
| 5911 | L4_MABX_B.LogicalOperator_m = (L4_MABX_B.Unit_Delay3 && L4_MABX_B.Compare_c1); |
| 5912 | |
| 5913 | /* UnitDelay: '<S649>/Unit_Delay' */ |
| 5914 | L4_MABX_B.Unit_Delay_c = L4_MABX_DW.Unit_Delay_DSTATE_i5; |
| 5915 | |
| 5916 | /* Logic: '<S655>/Logical Operator3' */ |
| 5917 | L4_MABX_B.LogicalOperator3_g = !L4_MABX_B.Unit_Delay_c; |
| 5918 | |
| 5919 | /* UnitDelay: '<S655>/Unit_Delay' */ |
| 5920 | L4_MABX_B.Unit_Delay_fd = L4_MABX_DW.Unit_Delay_DSTATE_eo; |
| 5921 | |
| 5922 | /* Logic: '<S655>/Logical Operator' */ |
| 5923 | L4_MABX_B.LogicalOperator_e = (L4_MABX_B.LogicalOperator3_g && |
| 5924 | L4_MABX_B.Unit_Delay_fd); |
| 5925 | |
| 5926 | /* Logic: '<S655>/Logical Operator1' */ |
| 5927 | L4_MABX_B.LogicalOperator1_e = (L4_MABX_B.LogicalOperator_m || |
| 5928 | L4_MABX_B.LogicalOperator_e); |
| 5929 | |
| 5930 | /* Outputs for Enabled SubSystem: '<S630>/SSI2_031' incorporates: |
| 5931 | * EnablePort: '<S631>/Enable' |
| 5932 | */ |
| 5933 | /* Constant: '<S450>/Constant' */ |
| 5934 | if (L4_MABX_P.Constant_Value_dn > 0.0) { |
| 5935 | /* S-Function (rti_commonblock): '<S631>/S-Function1' */ |
| 5936 | /* This comment workarounds a code generation problem */ |
| 5937 | |
| 5938 | /* dSPACE RTICAN RX Message Block: "SSI2_03" Id:217065731 */ |
| 5939 | { |
| 5940 | UInt32 *CAN_Msg; |
| 5941 | static dsfloat time_old = 0.0; |
| 5942 | |
| 5943 | /* Read status and timestamp info (previous message) */ |
| 5944 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02903].timestamp != |
| 5945 | time_old) { |
| 5946 | /* ... save timestamp info for the calculation of the RX status |
| 5947 | during the consecutive sample hit*/ |
| 5948 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02903]. |
| 5949 | timestamp; |
| 5950 | |
| 5951 | /* ... set the processed flag to one */ |
| 5952 | L4_MABX_B.SFunction1_o8_b4 = 1.0; |
| 5953 | L4_MABX_B.SFunction1_o9_k = (real_T) |
| 5954 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02903].timestamp; |
| 5955 | L4_MABX_B.SFunction1_o10_n = (real_T) |
| 5956 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02903].deltatime; |
| 5957 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02903].data; |
| 5958 | |
| 5959 | /* Decode CAN message */ |
| 5960 | { |
| 5961 | { |
| 5962 | rtican_Signal_t CAN_Sgn; |
| 5963 | |
| 5964 | /* ...... "PitchAngleExRange" (0|24, standard signal, unsigned int, little endian) */ |
| 5965 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 5966 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 5967 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[2]; |
| 5968 | CAN_Sgn.UnsignedSgn &= 0x00FFFFFF; |
| 5969 | L4_MABX_B.SFunction1_o1_ho = -250 + ( 3.0517578125E-5 * ( ((real_T) |
| 5970 | CAN_Sgn.UnsignedSgn) ) ); |
| 5971 | |
| 5972 | /* ...... "RollAngleExRange" (24|24, standard signal, unsigned int, little endian) */ |
| 5973 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 5974 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 5975 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[5]; |
| 5976 | CAN_Sgn.UnsignedSgn &= 0x00FFFFFF; |
| 5977 | L4_MABX_B.SFunction1_o2_kf = -250 + ( 3.0517578125E-5 * ( ((real_T) |
| 5978 | CAN_Sgn.UnsignedSgn) ) ); |
| 5979 | |
| 5980 | /* ...... "PitchAngleExRangeCompensation" (48|2, standard signal, unsigned int, little endian) */ |
| 5981 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 5982 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5983 | L4_MABX_B.SFunction1_o3_j = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5984 | |
| 5985 | /* ...... "PitchAngleExRangeFigureOfMerit" (50|2, standard signal, unsigned int, little endian) */ |
| 5986 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 5987 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 5988 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5989 | L4_MABX_B.SFunction1_o4_cv = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5990 | |
| 5991 | /* ...... "RollAngleExRangeCompensation" (52|2, standard signal, unsigned int, little endian) */ |
| 5992 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 5993 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 5994 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 5995 | L4_MABX_B.SFunction1_o5_n = ((real_T) CAN_Sgn.UnsignedSgn); |
| 5996 | |
| 5997 | /* ...... "RollAngleExRangeFigureOfMerit" (54|2, standard signal, unsigned int, little endian) */ |
| 5998 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 5999 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 6000 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 6001 | L4_MABX_B.SFunction1_o6_n = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6002 | |
| 6003 | /* ...... "RllAndPtchExRngMsurementLatency" (56|8, standard signal, unsigned int, little endian) */ |
| 6004 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 6005 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 6006 | L4_MABX_B.SFunction1_o7_k = 0.5 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 6007 | } |
| 6008 | } |
| 6009 | } else { |
| 6010 | /* set RX status to 0 because no new message has arrived */ |
| 6011 | L4_MABX_B.SFunction1_o8_b4 = 0.0; |
| 6012 | } |
| 6013 | } |
| 6014 | } |
| 6015 | |
| 6016 | /* End of Constant: '<S450>/Constant' */ |
| 6017 | /* End of Outputs for SubSystem: '<S630>/SSI2_031' */ |
| 6018 | |
| 6019 | /* DataTypeConversion: '<S630>/Data Type Conversion1' */ |
| 6020 | L4_MABX_B.PitchAngleExRange = L4_MABX_B.SFunction1_o1_ho; |
| 6021 | |
| 6022 | /* Outputs for Enabled SubSystem: '<S621>/PX2_LanePosEst' incorporates: |
| 6023 | * EnablePort: '<S624>/Enable' |
| 6024 | */ |
| 6025 | /* Constant: '<S447>/Constant' */ |
| 6026 | if (L4_MABX_P.Constant_Value_mx) { |
| 6027 | /* S-Function (rti_commonblock): '<S624>/S-Function1' */ |
| 6028 | /* This comment workarounds a code generation problem */ |
| 6029 | |
| 6030 | /* dSPACE RTICAN RX Message Block: "PX2_LanePosEst" Id:769 */ |
| 6031 | { |
| 6032 | UInt32 *CAN_Msg; |
| 6033 | static dsfloat time_old = 0.0; |
| 6034 | |
| 6035 | /* Read status and timestamp info (previous message) */ |
| 6036 | if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x301].timestamp != |
| 6037 | time_old) { |
| 6038 | /* ... save timestamp info for the calculation of the RX status |
| 6039 | during the consecutive sample hit*/ |
| 6040 | time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x301].timestamp; |
| 6041 | |
| 6042 | /* ... set the processed flag to one */ |
| 6043 | L4_MABX_B.SFunction1_o5_et = 1.0; |
| 6044 | L4_MABX_B.SFunction1_o6_h = (real_T) |
| 6045 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x301].timestamp; |
| 6046 | L4_MABX_B.SFunction1_o7_aw = (real_T) |
| 6047 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x301].deltatime; |
| 6048 | CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x301].data; |
| 6049 | |
| 6050 | /* Decode CAN message */ |
| 6051 | { |
| 6052 | { |
| 6053 | rtican_Signal_t CAN_Sgn; |
| 6054 | |
| 6055 | /* ...... "PX2_LanePosEstAngle" (0|16, standard signal, signed int, little endian) */ |
| 6056 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 6057 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 6058 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 6059 | if (CAN_Sgn.SignedSgn >> 15) { |
| 6060 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 6061 | } |
| 6062 | |
| 6063 | L4_MABX_B.SFunction1_o1_d5 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 6064 | |
| 6065 | /* ...... "PX2_LanePosEstNumPoints" (16|8, standard signal, unsigned int, little endian) */ |
| 6066 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 6067 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 6068 | L4_MABX_B.SFunction1_o2_b = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6069 | |
| 6070 | /* ...... "PX2_LanePosEstPosition" (24|16, standard signal, signed int, little endian) */ |
| 6071 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 6072 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 6073 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 6074 | if (CAN_Sgn.SignedSgn >> 15) { |
| 6075 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 6076 | } |
| 6077 | |
| 6078 | L4_MABX_B.SFunction1_o3_pj = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 6079 | |
| 6080 | /* ...... "PX2_LanePosEstNumLanes" (40|4, standard signal, unsigned int, little endian) */ |
| 6081 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 6082 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 6083 | L4_MABX_B.SFunction1_o4_oa = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6084 | } |
| 6085 | } |
| 6086 | } else { |
| 6087 | /* set RX status to 0 because no new message has arrived */ |
| 6088 | L4_MABX_B.SFunction1_o5_et = 0.0; |
| 6089 | } |
| 6090 | } |
| 6091 | } |
| 6092 | |
| 6093 | /* End of Outputs for SubSystem: '<S621>/PX2_LanePosEst' */ |
| 6094 | |
| 6095 | /* Outputs for Enabled SubSystem: '<S628>/Bendix_Prop2C2_Status_30' incorporates: |
| 6096 | * EnablePort: '<S629>/Enable' |
| 6097 | */ |
| 6098 | /* Constant: '<S449>/Constant' */ |
| 6099 | if (L4_MABX_P.Constant_Value_he > 0.0) { |
| 6100 | /* S-Function (rti_commonblock): '<S629>/S-Function1' */ |
| 6101 | /* This comment workarounds a code generation problem */ |
| 6102 | |
| 6103 | /* dSPACE RTICAN RX Message Block: "Prop2C2_Status_30" Id:419382064 */ |
| 6104 | { |
| 6105 | UInt32 *CAN_Msg; |
| 6106 | static dsfloat time_old = 0.0; |
| 6107 | |
| 6108 | /* Read status and timestamp info (previous message) */ |
| 6109 | if (can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF4330].timestamp != |
| 6110 | time_old) { |
| 6111 | /* ... save timestamp info for the calculation of the RX status |
| 6112 | during the consecutive sample hit*/ |
| 6113 | time_old = can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF4330]. |
| 6114 | timestamp; |
| 6115 | |
| 6116 | /* ... set the processed flag to one */ |
| 6117 | L4_MABX_B.SFunction1_o11_p = 1.0; |
| 6118 | L4_MABX_B.SFunction1_o12_i = (real_T) |
| 6119 | can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF4330].timestamp; |
| 6120 | L4_MABX_B.SFunction1_o13_b = (real_T) |
| 6121 | can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF4330].deltatime; |
| 6122 | CAN_Msg = can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF4330].data; |
| 6123 | |
| 6124 | /* Decode CAN message */ |
| 6125 | { |
| 6126 | { |
| 6127 | rtican_Signal_t CAN_Sgn; |
| 6128 | |
| 6129 | /* ...... "PressureP4" (0|8, standard signal, unsigned int, little endian) */ |
| 6130 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 6131 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 6132 | L4_MABX_B.SFunction1_o1_ii = 80 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 6133 | |
| 6134 | /* ...... "PressureP1" (8|8, standard signal, unsigned int, little endian) */ |
| 6135 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 6136 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 6137 | L4_MABX_B.SFunction1_o2_jx = 80 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 6138 | |
| 6139 | /* ...... "PressureP21" (16|8, standard signal, unsigned int, little endian) */ |
| 6140 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 6141 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 6142 | L4_MABX_B.SFunction1_o3_e = 80 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 6143 | |
| 6144 | /* ...... "PressureP22" (24|8, standard signal, unsigned int, little endian) */ |
| 6145 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 6146 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 6147 | L4_MABX_B.SFunction1_o4_h = 80 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 6148 | |
| 6149 | /* ...... "PressureP42" (32|8, standard signal, unsigned int, little endian) */ |
| 6150 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 6151 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 6152 | L4_MABX_B.SFunction1_o5_gv = 80 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 6153 | |
| 6154 | /* ...... "XPR1ControlStatus" (40|4, standard signal, unsigned int, little endian) */ |
| 6155 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 6156 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 6157 | L4_MABX_B.SFunction1_o6_b2 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6158 | |
| 6159 | /* ...... "XPR2ControlStatus" (44|4, standard signal, unsigned int, little endian) */ |
| 6160 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 6161 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 6162 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 6163 | L4_MABX_B.SFunction1_o7_cy = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6164 | |
| 6165 | /* ...... "XPR3ControlStatus" (48|4, standard signal, unsigned int, little endian) */ |
| 6166 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 6167 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 6168 | L4_MABX_B.SFunction1_o8_a5 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6169 | |
| 6170 | /* ...... "XPRErrorState" (56|2, standard signal, unsigned int, little endian) */ |
| 6171 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 6172 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 6173 | L4_MABX_B.SFunction1_o9_n = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6174 | |
| 6175 | /* ...... "XPRControlMode" (58|4, standard signal, unsigned int, little endian) */ |
| 6176 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 6177 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 6178 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 6179 | L4_MABX_B.SFunction1_o10_a = ((real_T) CAN_Sgn.UnsignedSgn); |
| 6180 | } |
| 6181 | } |
| 6182 | } else { |
| 6183 | /* set RX status to 0 because no new message has arrived */ |
| 6184 | L4_MABX_B.SFunction1_o11_p = 0.0; |
| 6185 | } |
| 6186 | } |
| 6187 | } |
| 6188 | |
| 6189 | /* End of Constant: '<S449>/Constant' */ |
| 6190 | /* End of Outputs for SubSystem: '<S628>/Bendix_Prop2C2_Status_30' */ |
| 6191 | |
| 6192 | /* DataTypeConversion: '<S628>/Data Type Conversion15' */ |
| 6193 | PositionFinalLimited = L4_MABX_B.SFunction1_o10_a; |
| 6194 | if (PositionFinalLimited < 256.0) { |
| 6195 | if (PositionFinalLimited >= 0.0) { |
| 6196 | starting_index = (uint8_T)PositionFinalLimited; |
| 6197 | } else { |
| 6198 | starting_index = 0U; |
| 6199 | } |
| 6200 | } else { |
| 6201 | starting_index = MAX_uint8_T; |
| 6202 | } |
| 6203 | |
| 6204 | L4_MABX_B.DataTypeConversion15_f = starting_index; |
| 6205 | |
| 6206 | /* End of DataTypeConversion: '<S628>/Data Type Conversion15' */ |
| 6207 | |
| 6208 | /* DataTypeConversion: '<S628>/Data Type Conversion5' */ |
| 6209 | L4_MABX_B.XPRControlMode = (ENUM_XPR_CONTROL_MODE_T) |
| 6210 | safe_cast_to_ENUM_XPR_CONTROL_M(L4_MABX_B.DataTypeConversion15_f); |
| 6211 | |
| 6212 | /* DataTypeConversion: '<S628>/Data Type Conversion4' */ |
| 6213 | PositionFinalLimited = L4_MABX_B.SFunction1_o9_n; |
| 6214 | if (PositionFinalLimited < 256.0) { |
| 6215 | if (PositionFinalLimited >= 0.0) { |
| 6216 | starting_index = (uint8_T)PositionFinalLimited; |
| 6217 | } else { |
| 6218 | starting_index = 0U; |
| 6219 | } |
| 6220 | } else { |
| 6221 | starting_index = MAX_uint8_T; |
| 6222 | } |
| 6223 | |
| 6224 | L4_MABX_B.DataTypeConversion4_k = starting_index; |
| 6225 | |
| 6226 | /* End of DataTypeConversion: '<S628>/Data Type Conversion4' */ |
| 6227 | |
| 6228 | /* DataTypeConversion: '<S628>/Data Type Conversion14' */ |
| 6229 | L4_MABX_B.XPRErrorState = (ENUM_XPR_ERROR_STATE_T) |
| 6230 | safe_cast_to_ENUM_XPR_ERROR_STA(L4_MABX_B.DataTypeConversion4_k); |
| 6231 | |
| 6232 | /* DataTypeConversion: '<S628>/Data Type Conversion7' */ |
| 6233 | L4_MABX_B.PressureP1 = L4_MABX_B.SFunction1_o2_jx; |
| 6234 | |
| 6235 | /* DataTypeConversion: '<S628>/Data Type Conversion6' */ |
| 6236 | L4_MABX_B.PressureP4 = L4_MABX_B.SFunction1_o1_ii; |
| 6237 | |
| 6238 | /* DataTypeConversion: '<S628>/Data Type Conversion11' */ |
| 6239 | L4_MABX_B.PressureP21 = L4_MABX_B.SFunction1_o3_e; |
| 6240 | |
| 6241 | /* DataTypeConversion: '<S628>/Data Type Conversion12' */ |
| 6242 | L4_MABX_B.PressureP22 = L4_MABX_B.SFunction1_o4_h; |
| 6243 | |
| 6244 | /* DataTypeConversion: '<S628>/Data Type Conversion13' */ |
| 6245 | L4_MABX_B.PressureP42 = L4_MABX_B.SFunction1_o5_gv; |
| 6246 | |
| 6247 | /* RelationalOperator: '<S660>/Operator' incorporates: |
| 6248 | * Constant: '<S466>/Constant3' |
| 6249 | * Constant: '<S658>/Constant1' |
| 6250 | */ |
| 6251 | L4_MABX_B.Operator_bx = (PROPB_REAX_CHANNEL_APV == |
| 6252 | L4_MABX_P.Constant1_Value_k0); |
| 6253 | |
| 6254 | /* Outputs for Enabled SubSystem: '<S578>/PropB_REAX_2_13' incorporates: |
| 6255 | * EnablePort: '<S580>/Enable' |
| 6256 | */ |
| 6257 | if (L4_MABX_B.Operator_bx) { |
| 6258 | /* S-Function (rti_commonblock): '<S580>/S-Function1' */ |
| 6259 | /* This comment workarounds a code generation problem */ |
| 6260 | |
| 6261 | /* dSPACE RTICAN RX Message Block: "PropB_REAX_2_13" Id:419426323 */ |
| 6262 | { |
| 6263 | UInt32 *CAN_Msg; |
| 6264 | static dsfloat time_old = 0.0; |
| 6265 | |
| 6266 | /* Read status and timestamp info (previous message) */ |
| 6267 | if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF013].timestamp != |
| 6268 | time_old) { |
| 6269 | /* ... save timestamp info for the calculation of the RX status |
| 6270 | during the consecutive sample hit*/ |
| 6271 | time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF013]. |
| 6272 | timestamp; |
| 6273 | |
| 6274 | /* ... set the processed flag to one */ |
| 6275 | L4_MABX_B.SFunction1_o3_di = 1.0; |
| 6276 | L4_MABX_B.SFunction1_o4_n = (real_T) |
| 6277 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF013].timestamp; |
| 6278 | L4_MABX_B.SFunction1_o5_i = (real_T) |
| 6279 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF013].deltatime; |
| 6280 | CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF013].data; |
| 6281 | |
| 6282 | /* Decode CAN message */ |
| 6283 | { |
| 6284 | { |
| 6285 | rtican_Signal_t CAN_Sgn; |
| 6286 | |
| 6287 | /* ...... "PropB_REAX_2_ActualHandwheelPos" (0|32, standard signal, signed int, little endian) */ |
| 6288 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 6289 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 6290 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[2]; |
| 6291 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[3]; |
| 6292 | L4_MABX_B.SFunction1_o1_gu = 0.0439453125 * ( ((real_T) |
| 6293 | CAN_Sgn.SignedSgn) ); |
| 6294 | |
| 6295 | /* ...... "PropB_REAX_2_EchoedStrWhlPos" (32|32, standard signal, signed int, little endian) */ |
| 6296 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 6297 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 6298 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[6]; |
| 6299 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[7]; |
| 6300 | L4_MABX_B.SFunction1_o2_e2 = 0.0439453125 * ( ((real_T) |
| 6301 | CAN_Sgn.SignedSgn) ); |
| 6302 | } |
| 6303 | } |
| 6304 | } else { |
| 6305 | /* set RX status to 0 because no new message has arrived */ |
| 6306 | L4_MABX_B.SFunction1_o3_di = 0.0; |
| 6307 | } |
| 6308 | } |
| 6309 | } |
| 6310 | |
| 6311 | /* End of Outputs for SubSystem: '<S578>/PropB_REAX_2_13' */ |
| 6312 | |
| 6313 | /* RelationalOperator: '<S659>/Operator' incorporates: |
| 6314 | * Constant: '<S466>/Constant3' |
| 6315 | * Constant: '<S658>/Constant' |
| 6316 | */ |
| 6317 | L4_MABX_B.Operator_h3 = (PROPB_REAX_CHANNEL_APV == L4_MABX_P.Constant_Value_cy); |
| 6318 | |
| 6319 | /* RelationalOperator: '<S661>/Operator' incorporates: |
| 6320 | * Constant: '<S466>/Constant3' |
| 6321 | * Constant: '<S658>/Constant2' |
| 6322 | */ |
| 6323 | L4_MABX_B.Operator_at = (PROPB_REAX_CHANNEL_APV == |
| 6324 | L4_MABX_P.Constant2_Value_gq); |
| 6325 | |
| 6326 | /* RelationalOperator: '<S662>/Operator' incorporates: |
| 6327 | * Constant: '<S466>/Constant3' |
| 6328 | * Constant: '<S658>/Constant3' |
| 6329 | */ |
| 6330 | L4_MABX_B.Operator_h2 = (PROPB_REAX_CHANNEL_APV == |
| 6331 | L4_MABX_P.Constant3_Value_fs); |
| 6332 | |
| 6333 | /* RelationalOperator: '<S663>/Operator' incorporates: |
| 6334 | * Constant: '<S466>/Constant3' |
| 6335 | * Constant: '<S658>/Constant4' |
| 6336 | */ |
| 6337 | L4_MABX_B.Operator_ns = (PROPB_REAX_CHANNEL_APV == |
| 6338 | L4_MABX_P.Constant4_Value_gz); |
| 6339 | |
| 6340 | /* RelationalOperator: '<S664>/Operator' incorporates: |
| 6341 | * Constant: '<S466>/Constant3' |
| 6342 | * Constant: '<S658>/Constant5' |
| 6343 | */ |
| 6344 | L4_MABX_B.Operator_e4 = (PROPB_REAX_CHANNEL_APV == L4_MABX_P.Constant5_Value_k); |
| 6345 | |
| 6346 | /* Logic: '<S466>/OR' */ |
| 6347 | L4_MABX_B.EnablePropB_ReAX_CAN6 = (L4_MABX_B.Operator_h3 || |
| 6348 | L4_MABX_B.Operator_at || L4_MABX_B.Operator_h2 || L4_MABX_B.Operator_ns || |
| 6349 | L4_MABX_B.Operator_e4); |
| 6350 | |
| 6351 | /* Outputs for Enabled SubSystem: '<S579>/PropB_REAX_2_13' incorporates: |
| 6352 | * EnablePort: '<S581>/Enable' |
| 6353 | */ |
| 6354 | if (L4_MABX_B.EnablePropB_ReAX_CAN6) { |
| 6355 | /* S-Function (rti_commonblock): '<S581>/S-Function1' */ |
| 6356 | /* This comment workarounds a code generation problem */ |
| 6357 | |
| 6358 | /* dSPACE RTICAN RX Message Block: "PropB_REAX_2_13" Id:486535187 */ |
| 6359 | { |
| 6360 | UInt32 *CAN_Msg; |
| 6361 | static dsfloat time_old = 0.0; |
| 6362 | |
| 6363 | /* Read status and timestamp info (previous message) */ |
| 6364 | if (can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF013].timestamp != |
| 6365 | time_old) { |
| 6366 | /* ... save timestamp info for the calculation of the RX status |
| 6367 | during the consecutive sample hit*/ |
| 6368 | time_old = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF013]. |
| 6369 | timestamp; |
| 6370 | |
| 6371 | /* ... set the processed flag to one */ |
| 6372 | L4_MABX_B.SFunction1_o3_mi = 1.0; |
| 6373 | L4_MABX_B.SFunction1_o4_b0 = (real_T) |
| 6374 | can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF013].timestamp; |
| 6375 | L4_MABX_B.SFunction1_o5_ej = (real_T) |
| 6376 | can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF013].deltatime; |
| 6377 | CAN_Msg = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF013].data; |
| 6378 | |
| 6379 | /* Decode CAN message */ |
| 6380 | { |
| 6381 | { |
| 6382 | rtican_Signal_t CAN_Sgn; |
| 6383 | |
| 6384 | /* ...... "PropB_REAX_2_ActualHandwheelPos" (0|32, standard signal, signed int, little endian) */ |
| 6385 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 6386 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 6387 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[2]; |
| 6388 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[3]; |
| 6389 | L4_MABX_B.SFunction1_o1_kg = 0.0439453125 * ( ((real_T) |
| 6390 | CAN_Sgn.SignedSgn) ); |
| 6391 | |
| 6392 | /* ...... "PropB_REAX_2_EchoedStrWhlPos" (32|32, standard signal, signed int, little endian) */ |
| 6393 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 6394 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 6395 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[6]; |
| 6396 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[7]; |
| 6397 | L4_MABX_B.SFunction1_o2_f2 = 0.0439453125 * ( ((real_T) |
| 6398 | CAN_Sgn.SignedSgn) ); |
| 6399 | } |
| 6400 | } |
| 6401 | } else { |
| 6402 | /* set RX status to 0 because no new message has arrived */ |
| 6403 | L4_MABX_B.SFunction1_o3_mi = 0.0; |
| 6404 | } |
| 6405 | } |
| 6406 | } |
| 6407 | |
| 6408 | /* End of Outputs for SubSystem: '<S579>/PropB_REAX_2_13' */ |
| 6409 | |
| 6410 | /* Switch: '<S443>/Switch' */ |
| 6411 | if (L4_MABX_B.Operator_bx) { |
| 6412 | ReAX_ActualHandwheelPos = L4_MABX_B.SFunction1_o1_gu; |
| 6413 | } else { |
| 6414 | ReAX_ActualHandwheelPos = L4_MABX_B.SFunction1_o1_kg; |
| 6415 | } |
| 6416 | |
| 6417 | /* S-Function (dsa_tcpip_setup_sfcn): '<S399>/dsa_tcpip_setup' */ |
| 6418 | |
| 6419 | /* Level2 S-Function Block: '<S399>/dsa_tcpip_setup' (dsa_tcpip_setup_sfcn) */ |
| 6420 | { |
| 6421 | SimStruct *rts = L4_MABX_M->childSfunctions[3]; |
| 6422 | ssSetOutputPortSignal(rts, 0, &EthernetLinkStatus); |
| 6423 | sfcnOutputs(rts,0); |
| 6424 | } |
| 6425 | |
| 6426 | /* Constant: '<S3>/Enable' */ |
| 6427 | L4_MABX_B.Enable = L4_MABX_P.Enable_Value; |
| 6428 | |
| 6429 | /* DiscretePulseGenerator: '<S398>/Heartbeat' */ |
| 6430 | L4_MABX_B.Heartbeat = (L4_MABX_DW.clockTickCounter < L4_MABX_P.Heartbeat_Duty) |
| 6431 | && (L4_MABX_DW.clockTickCounter >= 0) ? L4_MABX_P.Heartbeat_Amp : 0.0; |
| 6432 | if (L4_MABX_DW.clockTickCounter >= L4_MABX_P.Heartbeat_Period - 1.0) { |
| 6433 | L4_MABX_DW.clockTickCounter = 0; |
| 6434 | } else { |
| 6435 | L4_MABX_DW.clockTickCounter++; |
| 6436 | } |
| 6437 | |
| 6438 | /* End of DiscretePulseGenerator: '<S398>/Heartbeat' */ |
| 6439 | |
| 6440 | /* DataTypeConversion: '<S398>/Cast To Boolean' */ |
| 6441 | MABX_Heartbeat = (L4_MABX_B.Heartbeat != 0.0); |
| 6442 | |
| 6443 | /* UnitDelay: '<S3>/Unit_Delay' */ |
| 6444 | L4_MABX_B.EStop_j = L4_MABX_DW.Unit_Delay_80_DSTATE; |
| 6445 | L4_MABX_B.EnableSW = L4_MABX_DW.Unit_Delay_81_DSTATE; |
| 6446 | L4_MABX_B.EngageReq_c = L4_MABX_DW.Unit_Delay_48_DSTATE; |
| 6447 | L4_MABX_B.LogPB = L4_MABX_DW.Unit_Delay_83_DSTATE; |
| 6448 | L4_MABX_B.AutonomousEnabled_a = L4_MABX_DW.Unit_Delay_45_DSTATE; |
| 6449 | L4_MABX_B.MABX_Mode_h = L4_MABX_DW.Unit_Delay_47_DSTATE; |
| 6450 | L4_MABX_B.BrakeSW_j = L4_MABX_DW.Unit_Delay_84_DSTATE; |
| 6451 | |
| 6452 | /* BusCreator: '<S398>/Bus Creator' */ |
| 6453 | L4_MABX_B.BusCreator.Heartbeat = MABX_Heartbeat; |
| 6454 | L4_MABX_B.BusCreator.EStop = L4_MABX_B.EStop_j; |
| 6455 | L4_MABX_B.BusCreator.EnableSW = L4_MABX_B.EnableSW; |
| 6456 | L4_MABX_B.BusCreator.EngageReq = L4_MABX_B.EngageReq_c; |
| 6457 | L4_MABX_B.BusCreator.LogEventPB = L4_MABX_B.LogPB; |
| 6458 | L4_MABX_B.BusCreator.AutonomousEnabled = L4_MABX_B.AutonomousEnabled_a; |
| 6459 | L4_MABX_B.BusCreator.MABX_Mode = L4_MABX_B.MABX_Mode_h; |
| 6460 | L4_MABX_B.BusCreator.BrakeSW = L4_MABX_B.BrakeSW_j; |
| 6461 | |
| 6462 | /* S-Function (dsa_gen_tx_RTMapsEncode_sfun): '<S407>/Encoder' */ |
| 6463 | Update_Tx_RTMapsEncode((RTMapsTX*)&L4_MABX_B.BusCreator, |
| 6464 | &L4_MABX_B.Encoder_o1[0], &L4_MABX_B.Encoder_o2); |
| 6465 | |
| 6466 | /* S-Function (dsa_tcpip_udp_sfcn): '<S400>/TCPIP_Com' */ |
| 6467 | |
| 6468 | /* Level2 S-Function Block: '<S400>/TCPIP_Com' (dsa_tcpip_udp_sfcn) */ |
| 6469 | { |
| 6470 | SimStruct *rts = L4_MABX_M->childSfunctions[4]; |
| 6471 | sfcnOutputs(rts,0); |
| 6472 | } |
| 6473 | |
| 6474 | /* DataTypeConversion: '<S397>/Data Type Conversion' */ |
| 6475 | L4_MABX_B.DataTypeConversion_a = L4_MABX_B.TCPIP_Com_o2; |
| 6476 | |
| 6477 | /* S-Function (dsa_gen_rx_RTMapsDecode_sfun): '<S404>/Decoder' */ |
| 6478 | Update_Rx_RTMapsDecode((uint8_T*)&L4_MABX_B.TCPIP_Com_o3[0], |
| 6479 | L4_MABX_B.DataTypeConversion_a, L4_MABX_B.TCPIP_Com_o1[2], |
| 6480 | &L4_MABX_B.Decoder_o1, &L4_MABX_B.Decoder_o2, &L4_MABX_B.Decoder_o3); |
| 6481 | |
| 6482 | /* RelationalOperator: '<S406>/Compare' incorporates: |
| 6483 | * Constant: '<S406>/Constant' |
| 6484 | */ |
| 6485 | L4_MABX_B.Compare_c5 = ((int32_T)L4_MABX_B.Decoder_o1.Heartbeat > (int32_T) |
| 6486 | L4_MABX_P.Constant_Value_ap); |
| 6487 | |
| 6488 | /* UnitDelay: '<S405>/Delay Input1' */ |
| 6489 | L4_MABX_B.Uk1_f5 = L4_MABX_DW.DelayInput1_DSTATE_n; |
| 6490 | |
| 6491 | /* RelationalOperator: '<S405>/FixPt Relational Operator' */ |
| 6492 | L4_MABX_B.FixPtRelationalOperator_i = ((int32_T)L4_MABX_B.Compare_c5 > |
| 6493 | (int32_T)L4_MABX_B.Uk1_f5); |
| 6494 | |
| 6495 | /* UnitDelay: '<S403>/Unit Delay' */ |
| 6496 | L4_MABX_B.UnitDelay_f = L4_MABX_DW.UnitDelay_DSTATE_k; |
| 6497 | |
| 6498 | /* Switch: '<S403>/Switch' incorporates: |
| 6499 | * Constant: '<S403>/Constant1' |
| 6500 | */ |
| 6501 | if (L4_MABX_B.FixPtRelationalOperator_i) { |
| 6502 | L4_MABX_B.Count = L4_MABX_P.Constant1_Value_e; |
| 6503 | } else { |
| 6504 | /* Sum: '<S403>/Sum' incorporates: |
| 6505 | * Constant: '<S403>/Constant' |
| 6506 | */ |
| 6507 | L4_MABX_B.Sum_l = L4_MABX_P.Constant_Value_l + L4_MABX_B.UnitDelay_f; |
| 6508 | L4_MABX_B.Count = L4_MABX_B.Sum_l; |
| 6509 | } |
| 6510 | |
| 6511 | /* End of Switch: '<S403>/Switch' */ |
| 6512 | |
| 6513 | /* Switch: '<S403>/Switch1' incorporates: |
| 6514 | * Constant: '<S403>/Constant2' |
| 6515 | * Constant: '<S403>/Constant3' |
| 6516 | */ |
| 6517 | if (L4_MABX_B.Count > L4_MABX_P.Switch1_Threshold) { |
| 6518 | Heartbeat_Ok = L4_MABX_P.Constant2_Value_eu; |
| 6519 | } else { |
| 6520 | Heartbeat_Ok = L4_MABX_P.Constant3_Value_fa; |
| 6521 | } |
| 6522 | |
| 6523 | /* End of Switch: '<S403>/Switch1' */ |
| 6524 | |
| 6525 | /* Logic: '<S397>/AND' */ |
| 6526 | RTMapsOk = ((EthernetLinkStatus != 0.0) && Heartbeat_Ok); |
| 6527 | |
| 6528 | /* Switch: '<S397>/Switch9' incorporates: |
| 6529 | * Constant: '<S397>/Failure' |
| 6530 | */ |
| 6531 | if (RTMapsOk) { |
| 6532 | /* Gain: '<S397>/for_logging7' */ |
| 6533 | L4_MABX_B.SupervisorMode_b = (int8_T)(((uint32_T)L4_MABX_P.for_logging7_Gain |
| 6534 | * L4_MABX_B.Decoder_o1.SupervisorMode) >> 7); |
| 6535 | SupervisorMode = (uint8_T)L4_MABX_B.SupervisorMode_b; |
| 6536 | } else { |
| 6537 | SupervisorMode = L4_MABX_P.Failure_Value_k; |
| 6538 | } |
| 6539 | |
| 6540 | /* End of Switch: '<S397>/Switch9' */ |
| 6541 | |
| 6542 | /* RelationalOperator: '<S402>/Operator' incorporates: |
| 6543 | * Constant: '<S397>/Supervisor_Autonomous_Mode' |
| 6544 | */ |
| 6545 | L4_MABX_B.Operator_m1 = (L4_MABX_P.Supervisor_Autonomous_Mode_Valu == |
| 6546 | SupervisorMode); |
| 6547 | |
| 6548 | /* Logic: '<S397>/AND1' */ |
| 6549 | L4_MABX_B.SystemsOk = (RTMapsOk && L4_MABX_B.Operator_m1); |
| 6550 | |
| 6551 | /* Switch: '<S397>/Switch' incorporates: |
| 6552 | * Constant: '<S397>/No Data' |
| 6553 | * Switch: '<S397>/Switch1' |
| 6554 | * Switch: '<S397>/Switch3' |
| 6555 | * Switch: '<S397>/Switch4' |
| 6556 | * Switch: '<S397>/Switch5' |
| 6557 | */ |
| 6558 | if (RTMapsOk) { |
| 6559 | /* Gain: '<S397>/for_logging' */ |
| 6560 | L4_MABX_B.for_logging = L4_MABX_P.for_logging_Gain * |
| 6561 | L4_MABX_B.Decoder_o1.CurrentAzimuth; |
| 6562 | CurrentAzimuth_rad = L4_MABX_B.for_logging; |
| 6563 | |
| 6564 | /* Gain: '<S397>/for_logging1' */ |
| 6565 | L4_MABX_B.for_logging1 = L4_MABX_P.for_logging1_Gain * |
| 6566 | L4_MABX_B.Decoder_o1.TargetAzimuth; |
| 6567 | TargetAzimuth_rad = L4_MABX_B.for_logging1; |
| 6568 | |
| 6569 | /* Gain: '<S397>/m//s_to_km//h_2' */ |
| 6570 | L4_MABX_B.ms_to_kmh_2 = L4_MABX_P.ms_to_kmh_2_Gain * |
| 6571 | L4_MABX_B.Decoder_o1.TargetVelocity; |
| 6572 | TargetVelocity_kph = L4_MABX_B.ms_to_kmh_2; |
| 6573 | |
| 6574 | /* Gain: '<S397>/for_logging2' */ |
| 6575 | L4_MABX_B.for_logging2 = L4_MABX_P.for_logging2_Gain * |
| 6576 | L4_MABX_B.Decoder_o1.Curvature; |
| 6577 | Curvature = L4_MABX_B.for_logging2; |
| 6578 | |
| 6579 | /* Gain: '<S397>/for_logging3' */ |
| 6580 | L4_MABX_B.for_logging3 = L4_MABX_P.for_logging3_Gain * |
| 6581 | L4_MABX_B.Decoder_o1.CrosstrackError; |
| 6582 | CrosstrackError = L4_MABX_B.for_logging3; |
| 6583 | } else { |
| 6584 | CurrentAzimuth_rad = L4_MABX_P.NoData_Value; |
| 6585 | TargetAzimuth_rad = L4_MABX_P.NoData_Value; |
| 6586 | TargetVelocity_kph = L4_MABX_P.NoData_Value; |
| 6587 | Curvature = L4_MABX_P.NoData_Value; |
| 6588 | CrosstrackError = L4_MABX_P.NoData_Value; |
| 6589 | } |
| 6590 | |
| 6591 | /* End of Switch: '<S397>/Switch' */ |
| 6592 | |
| 6593 | /* Outputs for Atomic SubSystem: '<S65>/Task_10ms' */ |
| 6594 | /* Logic: '<S76>/NOT' */ |
| 6595 | L4_MABX_B.NOT_g = !BrakeSW; |
| 6596 | |
| 6597 | /* Sum: '<S96>/Subtract' */ |
| 6598 | L4_MABX_B.Subtract_a = TargetVelocity_kph - L4_MABX_B.SFunction1_o1_ee; |
| 6599 | |
| 6600 | /* RelationalOperator: '<S101>/Compare' incorporates: |
| 6601 | * Constant: '<S101>/Constant' |
| 6602 | */ |
| 6603 | L4_MABX_B.Compare_i = (L4_MABX_B.Subtract_a >= |
| 6604 | L4_MABX_P.CompareToConstant_const_a); |
| 6605 | |
| 6606 | /* Logic: '<S96>/AND' */ |
| 6607 | EngageReq = (EngagePB && L4_MABX_B.Compare_i); |
| 6608 | |
| 6609 | /* UnitDelay: '<S76>/Unit_Delay' */ |
| 6610 | L4_MABX_B.Unit_Delay_nh = L4_MABX_DW.Unit_Delay_DSTATE_fv; |
| 6611 | |
| 6612 | /* Logic: '<S76>/OR' */ |
| 6613 | L4_MABX_B.OR_l = (EngageReq || L4_MABX_B.Unit_Delay_nh); |
| 6614 | |
| 6615 | /* UnitDelay: '<S97>/Unit Delay1' */ |
| 6616 | L4_MABX_B.UnitDelay1_f = L4_MABX_DW.UnitDelay1_DSTATE_m; |
| 6617 | |
| 6618 | /* RelationalOperator: '<S100>/Compare' incorporates: |
| 6619 | * Constant: '<S100>/Constant' |
| 6620 | */ |
| 6621 | L4_MABX_B.Compare_jp = ((int32_T)L4_MABX_B.Unit_Delay_nh <= (int32_T) |
| 6622 | L4_MABX_P.Constant_Value_ioa); |
| 6623 | |
| 6624 | /* UnitDelay: '<S98>/Delay Input1' */ |
| 6625 | L4_MABX_B.Uk1_d = L4_MABX_DW.DelayInput1_DSTATE_d; |
| 6626 | |
| 6627 | /* RelationalOperator: '<S98>/FixPt Relational Operator' */ |
| 6628 | L4_MABX_B.FixPtRelationalOperator_o = ((int32_T)L4_MABX_B.Compare_jp > |
| 6629 | (int32_T)L4_MABX_B.Uk1_d); |
| 6630 | |
| 6631 | /* UnitDelay: '<S97>/Unit Delay' */ |
| 6632 | L4_MABX_B.UnitDelay_i3 = L4_MABX_DW.UnitDelay_DSTATE_b1; |
| 6633 | |
| 6634 | /* Logic: '<S97>/OR' */ |
| 6635 | L4_MABX_B.OR_e = (L4_MABX_B.FixPtRelationalOperator_o || |
| 6636 | L4_MABX_B.UnitDelay_i3); |
| 6637 | |
| 6638 | /* Switch: '<S97>/Switch' incorporates: |
| 6639 | * Constant: '<S97>/Constant0' |
| 6640 | */ |
| 6641 | if (L4_MABX_B.OR_e) { |
| 6642 | /* Sum: '<S97>/Sum' incorporates: |
| 6643 | * Constant: '<S97>/Constant1' |
| 6644 | */ |
| 6645 | L4_MABX_B.Sum_g = L4_MABX_B.UnitDelay1_f + L4_MABX_P.Constant1_Value; |
| 6646 | L4_MABX_B.Switch_a = L4_MABX_B.Sum_g; |
| 6647 | } else { |
| 6648 | L4_MABX_B.Switch_a = L4_MABX_P.Constant0_Value; |
| 6649 | } |
| 6650 | |
| 6651 | /* End of Switch: '<S97>/Switch' */ |
| 6652 | |
| 6653 | /* RelationalOperator: '<S99>/Compare' incorporates: |
| 6654 | * Constant: '<S99>/Constant' |
| 6655 | */ |
| 6656 | L4_MABX_B.Compare_fh = (L4_MABX_B.Switch_a > L4_MABX_P.Constant_Value_hq); |
| 6657 | |
| 6658 | /* Gain: '<S97>/Gain' incorporates: |
| 6659 | * Constant: '<S95>/2000ms Delay' |
| 6660 | */ |
| 6661 | L4_MABX_B.Gain_co = (uint32_T)L4_MABX_P.Gain_Gain_bn * |
| 6662 | L4_MABX_P.u000msDelay_Value; |
| 6663 | |
| 6664 | /* RelationalOperator: '<S97>/LessThanOrEqual' */ |
| 6665 | L4_MABX_B.LessThanOrEqual_gm = (L4_MABX_B.Switch_a <= (real_T) |
| 6666 | L4_MABX_B.Gain_co * 1.9073486328125E-6); |
| 6667 | |
| 6668 | /* Logic: '<S97>/AND' */ |
| 6669 | L4_MABX_B.AND_fu = (L4_MABX_B.Compare_fh && L4_MABX_B.LessThanOrEqual_gm); |
| 6670 | |
| 6671 | /* Logic: '<S95>/NOT1' */ |
| 6672 | L4_MABX_B.NOT1 = !L4_MABX_B.AND_fu; |
| 6673 | |
| 6674 | /* Logic: '<S76>/AND' */ |
| 6675 | AutonomousEnabled = (L4_MABX_B.SystemsOk && EStop && EnableSw && |
| 6676 | L4_MABX_B.NOT_g && L4_MABX_B.OR_l && L4_MABX_B.NOT1); |
| 6677 | |
| 6678 | /* Logic: '<S83>/Logical Operator' */ |
| 6679 | L4_MABX_B.LogicalOperator_d = !AutonomousEnabled; |
| 6680 | |
| 6681 | /* Outputs for Atomic SubSystem: '<S83>/If_Then_Else' */ |
| 6682 | |
| 6683 | /* Constant: '<S83>/APTC_PEDAL_POSITION_OVR_APV' incorporates: |
| 6684 | * Constant: '<S83>/APTC_DESIRED_PEDAL_POSITION_APV' |
| 6685 | */ |
| 6686 | L4_MABX_If_Then_Else(L4_MABX_P.APTC_PEDAL_POSITION_OVR_APV_Val, |
| 6687 | L4_MABX_P.APTC_DESIRED_PEDAL_POSITION_APV, |
| 6688 | Pedal_pwm_position, &L4_MABX_B.If_Then_Else_o); |
| 6689 | |
| 6690 | /* End of Outputs for SubSystem: '<S83>/If_Then_Else' */ |
| 6691 | |
| 6692 | /* DataTypeConversion: '<S83>/Data Type Conversion1' */ |
| 6693 | L4_MABX_B.DataTypeConversion1_h = L4_MABX_B.SFunction1_o5_l; |
| 6694 | |
| 6695 | /* Lookup_n-D: '<S83>/2-D Lookup Table' */ |
| 6696 | L4_MABX_B.uDLookupTable = look2_binlcapw(L4_MABX_B.If_Then_Else_o.Switch, |
| 6697 | L4_MABX_B.DataTypeConversion1_h, APTC_TRQ_PED_TRQ_POS_STEP_MPV, |
| 6698 | APTC_TRQ_PED_TRQ_ESPD_STEP_MPV, APTC_TRQ_PED_TRQ_DATA_MPV, |
| 6699 | L4_MABX_P.uDLookupTable_maxIndex, 8U); |
| 6700 | |
| 6701 | /* DataTypeConversion: '<S77>/Data Type Conversion5' */ |
| 6702 | L4_MABX_B.DataTypeConversion5_oo = L4_MABX_B.SFunction1_o1_ee; |
| 6703 | |
| 6704 | /* RateTransition: '<S81>/TmpRTBAtSignal Conversion1Inport1' */ |
| 6705 | if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) { |
| 6706 | L4_MABX_B.distanceSpdTarget_e = L4_MABX_DW.TmpRTBAtSignalConversion1Inport; |
| 6707 | } |
| 6708 | |
| 6709 | /* MultiPortSwitch: '<S81>/Multiport Switch' incorporates: |
| 6710 | * Constant: '<S81>/LONG_SPEED_SRC_SELECTOR_APV' |
| 6711 | */ |
| 6712 | switch (LONG_SPEED_SRC_SELECTOR_APV) { |
| 6713 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH: |
| 6714 | /* SignalConversion: '<S81>/Signal Conversion1' */ |
| 6715 | L4_MABX_B.Vehicle_speed_target_g = L4_MABX_B.distanceSpdTarget_e; |
| 6716 | L4_MABX_B.Vehicle_speed_target_o = L4_MABX_B.Vehicle_speed_target_g; |
| 6717 | break; |
| 6718 | |
| 6719 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE: |
| 6720 | /* SignalConversion: '<S81>/Signal Conversion4' incorporates: |
| 6721 | * Constant: '<S81>/VSPD_TARGET_KPH_APV' |
| 6722 | */ |
| 6723 | L4_MABX_B.Vehicle_speed_target_o5 = VSPD_TARGET_KPH_APV; |
| 6724 | L4_MABX_B.Vehicle_speed_target_o = L4_MABX_B.Vehicle_speed_target_o5; |
| 6725 | break; |
| 6726 | |
| 6727 | default: |
| 6728 | /* SignalConversion: '<S81>/Signal Conversion9' */ |
| 6729 | L4_MABX_B.Vehicle_speed_target_k = TargetVelocity_kph; |
| 6730 | L4_MABX_B.Vehicle_speed_target_o = L4_MABX_B.Vehicle_speed_target_k; |
| 6731 | break; |
| 6732 | } |
| 6733 | |
| 6734 | /* SignalConversion: '<S81>/Signal Conversion16' */ |
| 6735 | L4_MABX_B.VSPD_TARGET_KPH_APV_g = L4_MABX_B.Vehicle_speed_target_o; |
| 6736 | |
| 6737 | /* Saturate: '<S81>/Saturation9' incorporates: |
| 6738 | * Constant: '<S81>/VSPD_HYST_KPH_APV' |
| 6739 | */ |
| 6740 | DeltaTime = L4_MABX_P.VSPD_HYST_KPH_APV_Value; |
| 6741 | Time56 = L4_MABX_P.Saturation9_LowerSat; |
| 6742 | PositionFinalLimited = L4_MABX_P.Saturation9_UpperSat; |
| 6743 | if (DeltaTime > PositionFinalLimited) { |
| 6744 | L4_MABX_B.VSPD_HYST_KPH_APV_f = PositionFinalLimited; |
| 6745 | } else if (DeltaTime < Time56) { |
| 6746 | L4_MABX_B.VSPD_HYST_KPH_APV_f = Time56; |
| 6747 | } else { |
| 6748 | L4_MABX_B.VSPD_HYST_KPH_APV_f = DeltaTime; |
| 6749 | } |
| 6750 | |
| 6751 | /* End of Saturate: '<S81>/Saturation9' */ |
| 6752 | |
| 6753 | /* Sum: '<S109>/Add' */ |
| 6754 | L4_MABX_B.Add_k = L4_MABX_B.VSPD_TARGET_KPH_APV_g + |
| 6755 | L4_MABX_B.VSPD_HYST_KPH_APV_f; |
| 6756 | |
| 6757 | /* RelationalOperator: '<S109>/Relational Operator' */ |
| 6758 | L4_MABX_B.f_vspd_geq_than_target_plus_hys = (L4_MABX_B.DataTypeConversion5_oo >= |
| 6759 | L4_MABX_B.Add_k); |
| 6760 | |
| 6761 | /* Saturate: '<S81>/Saturation1' incorporates: |
| 6762 | * Constant: '<S81>/VSPD_BRAKE_STOP_THRESH_KPH_APV' |
| 6763 | */ |
| 6764 | DeltaTime = L4_MABX_P.VSPD_BRAKE_STOP_THRESH_KPH_APV_; |
| 6765 | Time56 = L4_MABX_P.Saturation1_LowerSat; |
| 6766 | PositionFinalLimited = L4_MABX_P.Saturation1_UpperSat; |
| 6767 | if (DeltaTime > PositionFinalLimited) { |
| 6768 | L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b = PositionFinalLimited; |
| 6769 | } else if (DeltaTime < Time56) { |
| 6770 | L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b = Time56; |
| 6771 | } else { |
| 6772 | L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b = DeltaTime; |
| 6773 | } |
| 6774 | |
| 6775 | /* End of Saturate: '<S81>/Saturation1' */ |
| 6776 | |
| 6777 | /* RelationalOperator: '<S109>/Relational Operator1' */ |
| 6778 | L4_MABX_B.f_target_is_stop_thresh = (L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b |
| 6779 | == L4_MABX_B.VSPD_TARGET_KPH_APV_g); |
| 6780 | |
| 6781 | /* RelationalOperator: '<S205>/Compare' incorporates: |
| 6782 | * Constant: '<S205>/Constant' |
| 6783 | */ |
| 6784 | L4_MABX_B.Compare_eu = (L4_MABX_B.VSPD_TARGET_KPH_APV_g == |
| 6785 | L4_MABX_P.Constant_Value_k); |
| 6786 | |
| 6787 | /* RelationalOperator: '<S109>/Relational Operator2' */ |
| 6788 | L4_MABX_B.RelationalOperator2_p = (L4_MABX_B.VSPD_HYST_KPH_APV_f >= |
| 6789 | L4_MABX_B.VSPD_TARGET_KPH_APV_g); |
| 6790 | |
| 6791 | /* RelationalOperator: '<S109>/Relational Operator3' */ |
| 6792 | L4_MABX_B.RelationalOperator3 = (L4_MABX_B.VSPD_HYST_KPH_APV_f >= |
| 6793 | L4_MABX_B.DataTypeConversion5_oo); |
| 6794 | |
| 6795 | /* Logic: '<S109>/Logical Operator' */ |
| 6796 | L4_MABX_B.f_vspd_leq_than_hyst_and_target = (L4_MABX_B.RelationalOperator2_p && |
| 6797 | L4_MABX_B.RelationalOperator3); |
| 6798 | |
| 6799 | /* Logic: '<S109>/Logical Operator1' */ |
| 6800 | L4_MABX_B.LogicalOperator1_m = (L4_MABX_B.f_vspd_geq_than_target_plus_hys || |
| 6801 | L4_MABX_B.f_target_is_stop_thresh || L4_MABX_B.Compare_eu || |
| 6802 | L4_MABX_B.f_vspd_leq_than_hyst_and_target); |
| 6803 | |
| 6804 | /* DataTypeConversion: '<S77>/Data Type Conversion4' */ |
| 6805 | L4_MABX_B.DataTypeConversion4_d5 = AutonomousEnabled; |
| 6806 | |
| 6807 | /* Logic: '<S109>/Logical Operator2' */ |
| 6808 | L4_MABX_B.F_Brake_control_active = (L4_MABX_B.LogicalOperator1_m && |
| 6809 | L4_MABX_B.DataTypeConversion4_d5); |
| 6810 | |
| 6811 | /* DataTypeConversion: '<S79>/Data Type Conversion4' */ |
| 6812 | L4_MABX_B.DataTypeConversion4_ib = L4_MABX_B.SFunction1_o1_ee; |
| 6813 | |
| 6814 | /* DataTypeConversion: '<S77>/Data Type Conversion1' */ |
| 6815 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_fx; |
| 6816 | if (PositionFinalLimited < 256.0) { |
| 6817 | if (PositionFinalLimited >= 0.0) { |
| 6818 | starting_index = (uint8_T)PositionFinalLimited; |
| 6819 | } else { |
| 6820 | starting_index = 0U; |
| 6821 | } |
| 6822 | } else { |
| 6823 | starting_index = MAX_uint8_T; |
| 6824 | } |
| 6825 | |
| 6826 | L4_MABX_B.DataTypeConversion1_ba = starting_index; |
| 6827 | |
| 6828 | /* End of DataTypeConversion: '<S77>/Data Type Conversion1' */ |
| 6829 | |
| 6830 | /* DataTypeConversion: '<S77>/Data Type Conversion3' */ |
| 6831 | L4_MABX_B.BrkPedArbBrakeSwitch_c = (ENUM_J1939_SWITCH_T) |
| 6832 | L4_MABX_B.DataTypeConversion1_ba; |
| 6833 | |
| 6834 | /* DataTypeConversion: '<S209>/Data Type Conversion1' */ |
| 6835 | L4_MABX_B.DataTypeConversion1_c = L4_MABX_B.BrkPedArbBrakeSwitch_c; |
| 6836 | |
| 6837 | /* RelationalOperator: '<S215>/Compare' incorporates: |
| 6838 | * Constant: '<S215>/Constant' |
| 6839 | */ |
| 6840 | L4_MABX_B.Compare_e5 = (L4_MABX_B.DataTypeConversion1_c == |
| 6841 | L4_MABX_P.CompareToConstant2_const); |
| 6842 | |
| 6843 | /* Logic: '<S209>/Logical Operator2' */ |
| 6844 | L4_MABX_B.LogicalOperator2_nt = !L4_MABX_B.Compare_e5; |
| 6845 | |
| 6846 | /* DataTypeConversion: '<S209>/Data Type Conversion5' */ |
| 6847 | PositionFinalLimited = floor(L4_MABX_B.SFunction1_o4_mt); |
| 6848 | if (rtIsNaN(PositionFinalLimited) || rtIsInf(PositionFinalLimited)) { |
| 6849 | PositionFinalLimited = 0.0; |
| 6850 | } else { |
| 6851 | PositionFinalLimited = fmod(PositionFinalLimited, 256.0); |
| 6852 | } |
| 6853 | |
| 6854 | L4_MABX_B.DataTypeConversion5_p = (uint8_T)(PositionFinalLimited < 0.0 ? |
| 6855 | (int32_T)(uint8_T)-(int8_T)(uint8_T)-PositionFinalLimited : (int32_T) |
| 6856 | (uint8_T)PositionFinalLimited); |
| 6857 | |
| 6858 | /* End of DataTypeConversion: '<S209>/Data Type Conversion5' */ |
| 6859 | |
| 6860 | /* DataTypeConversion: '<S209>/Data Type Conversion3' */ |
| 6861 | L4_MABX_B.DataTypeConversion3_l5 = (ENUM_J1939_SWITCH_T) |
| 6862 | L4_MABX_B.DataTypeConversion5_p; |
| 6863 | |
| 6864 | /* RelationalOperator: '<S213>/Compare' incorporates: |
| 6865 | * Constant: '<S213>/Constant' |
| 6866 | */ |
| 6867 | L4_MABX_B.Compare_ih = (L4_MABX_B.DataTypeConversion3_l5 == |
| 6868 | L4_MABX_P.CompareToConstant_const_e); |
| 6869 | |
| 6870 | /* RelationalOperator: '<S214>/Compare' incorporates: |
| 6871 | * Constant: '<S214>/Constant' |
| 6872 | */ |
| 6873 | L4_MABX_B.Compare_ex = (L4_MABX_B.DataTypeConversion3_l5 == |
| 6874 | L4_MABX_P.CompareToConstant1_const_j); |
| 6875 | |
| 6876 | /* Logic: '<S209>/BrakingActive2' */ |
| 6877 | L4_MABX_B.BrakingActive2 = (L4_MABX_B.Compare_ih || L4_MABX_B.Compare_ex); |
| 6878 | |
| 6879 | /* Logic: '<S209>/BrakingActive1' */ |
| 6880 | L4_MABX_B.f_brake_sw_off = (L4_MABX_B.LogicalOperator2_nt && |
| 6881 | L4_MABX_B.BrakingActive2); |
| 6882 | |
| 6883 | /* RelationalOperator: '<S216>/Compare' incorporates: |
| 6884 | * Constant: '<S216>/Constant' |
| 6885 | */ |
| 6886 | L4_MABX_B.Compare_a = (L4_MABX_B.SPN524_TransSelectedGear > |
| 6887 | L4_MABX_P.Constant_Value_il); |
| 6888 | |
| 6889 | /* RelationalOperator: '<S217>/Compare' incorporates: |
| 6890 | * Constant: '<S217>/Constant' |
| 6891 | */ |
| 6892 | L4_MABX_B.Compare_os = (L4_MABX_B.SPN523_TransCurrentGear > |
| 6893 | L4_MABX_P.Constant_Value_f); |
| 6894 | |
| 6895 | /* Logic: '<S209>/Logical Operator1' */ |
| 6896 | L4_MABX_B.f_brk_gov_inactive = !L4_MABX_B.F_Brake_control_active; |
| 6897 | |
| 6898 | /* Logic: '<S209>/Logical Operator' */ |
| 6899 | L4_MABX_B.LogicalOperator_k = (AutonomousEnabled && L4_MABX_B.f_brake_sw_off && |
| 6900 | L4_MABX_B.Compare_a && L4_MABX_B.Compare_os && L4_MABX_B.f_brk_gov_inactive); |
| 6901 | |
| 6902 | /* Outputs for Enabled SubSystem: '<S79>/Throttle_controller_gov' incorporates: |
| 6903 | * EnablePort: '<S212>/Enable' |
| 6904 | */ |
| 6905 | if (L4_MABX_B.LogicalOperator_k) { |
| 6906 | if (!L4_MABX_DW.Throttle_controller_gov_MODE) { |
| 6907 | /* InitializeConditions for UnitDelay: '<S220>/Unit_Delay1' */ |
| 6908 | L4_MABX_DW.Unit_Delay1_DSTATE_p1 = |
| 6909 | L4_MABX_P.Unit_Delay1_InitialCondition_o; |
| 6910 | |
| 6911 | /* InitializeConditions for UnitDelay: '<S220>/Unit_Delay' */ |
| 6912 | L4_MABX_DW.Unit_Delay_DSTATE_lqi = |
| 6913 | L4_MABX_P.Unit_Delay_InitialCondition_b2; |
| 6914 | |
| 6915 | /* InitializeConditions for UnitDelay: '<S247>/Unit_Delay' */ |
| 6916 | L4_MABX_DW.Unit_Delay_DSTATE_be = L4_MABX_P.Unit_Delay_InitialCondition_lj; |
| 6917 | |
| 6918 | /* InitializeConditions for UnitDelay: '<S267>/Unit_Delay1' */ |
| 6919 | L4_MABX_DW.Unit_Delay1_DSTATE_h = L4_MABX_P.Unit_Delay1_InitialCondition_a; |
| 6920 | |
| 6921 | /* InitializeConditions for UnitDelay: '<S268>/Unit_Delay' */ |
| 6922 | L4_MABX_DW.Unit_Delay_DSTATE_fi = L4_MABX_P.Unit_Delay_InitialCondition_bm; |
| 6923 | |
| 6924 | /* InitializeConditions for UnitDelay: '<S272>/FixPt Unit Delay2' */ |
| 6925 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_gq = |
| 6926 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_a; |
| 6927 | |
| 6928 | /* InitializeConditions for UnitDelay: '<S272>/FixPt Unit Delay1' */ |
| 6929 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_a = |
| 6930 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_o; |
| 6931 | |
| 6932 | /* InitializeConditions for UnitDelay: '<S267>/Unit_Delay2' */ |
| 6933 | L4_MABX_DW.Unit_Delay2_DSTATE_mh = |
| 6934 | L4_MABX_P.Unit_Delay2_InitialCondition_j; |
| 6935 | |
| 6936 | /* InitializeConditions for UnitDelay: '<S222>/Unit_Delay' */ |
| 6937 | L4_MABX_DW.Unit_Delay_DSTATE_fz = L4_MABX_P.Unit_Delay_InitialCondition_kg; |
| 6938 | L4_MABX_DW.Throttle_controller_gov_MODE = true; |
| 6939 | } |
| 6940 | |
| 6941 | /* DataTypeConversion: '<S219>/Data Type Conversion9' */ |
| 6942 | L4_MABX_B.DataTypeConversion9_h = L4_MABX_B.SFunction1_o4_jq; |
| 6943 | |
| 6944 | /* DataTypeConversion: '<S219>/Data Type Conversion1' */ |
| 6945 | L4_MABX_B.DataTypeConversion1_iq = L4_MABX_B.SFunction1_o2_eg; |
| 6946 | |
| 6947 | /* Sum: '<S219>/Add' */ |
| 6948 | L4_MABX_B.Add_di = L4_MABX_B.DataTypeConversion9_h + |
| 6949 | L4_MABX_B.DataTypeConversion1_iq; |
| 6950 | |
| 6951 | /* RelationalOperator: '<S224>/Relational Operator1' incorporates: |
| 6952 | * Constant: '<S219>/Constant1' |
| 6953 | */ |
| 6954 | L4_MABX_B.RelationalOperator1_n = (L4_MABX_B.Add_di >= |
| 6955 | L4_MABX_P.Constant1_Value_c); |
| 6956 | |
| 6957 | /* RelationalOperator: '<S224>/Relational Operator' incorporates: |
| 6958 | * Constant: '<S219>/Constant3' |
| 6959 | */ |
| 6960 | L4_MABX_B.RelationalOperator_d3 = (L4_MABX_B.Add_di <= |
| 6961 | L4_MABX_P.Constant3_Value_d); |
| 6962 | |
| 6963 | /* Outputs for Atomic SubSystem: '<S224>/If_Then_Else1' */ |
| 6964 | |
| 6965 | /* Constant: '<S219>/Constant3' */ |
| 6966 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_d3, |
| 6967 | L4_MABX_P.Constant3_Value_d, L4_MABX_B.Add_di, |
| 6968 | &L4_MABX_B.If_Then_Else1_h); |
| 6969 | |
| 6970 | /* End of Outputs for SubSystem: '<S224>/If_Then_Else1' */ |
| 6971 | |
| 6972 | /* Outputs for Atomic SubSystem: '<S224>/If_Then_Else' */ |
| 6973 | |
| 6974 | /* Constant: '<S219>/Constant1' */ |
| 6975 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_n, |
| 6976 | L4_MABX_P.Constant1_Value_c, |
| 6977 | L4_MABX_B.If_Then_Else1_h.Switch, |
| 6978 | &L4_MABX_B.If_Then_Else_ct); |
| 6979 | |
| 6980 | /* End of Outputs for SubSystem: '<S224>/If_Then_Else' */ |
| 6981 | |
| 6982 | /* DataTypeConversion: '<S219>/Data Type Conversion2' */ |
| 6983 | L4_MABX_B.DataTypeConversion2_i = L4_MABX_B.SPN514_NominalFrictionPercentTo; |
| 6984 | |
| 6985 | /* RelationalOperator: '<S225>/Relational Operator1' incorporates: |
| 6986 | * Constant: '<S219>/Constant2' |
| 6987 | */ |
| 6988 | L4_MABX_B.RelationalOperator1_ch = (L4_MABX_B.DataTypeConversion2_i >= |
| 6989 | L4_MABX_P.Constant2_Value_b); |
| 6990 | |
| 6991 | /* RelationalOperator: '<S225>/Relational Operator' incorporates: |
| 6992 | * Constant: '<S219>/Constant4' |
| 6993 | */ |
| 6994 | L4_MABX_B.RelationalOperator_j = (L4_MABX_B.DataTypeConversion2_i <= |
| 6995 | L4_MABX_P.Constant4_Value); |
| 6996 | |
| 6997 | /* Outputs for Atomic SubSystem: '<S225>/If_Then_Else1' */ |
| 6998 | |
| 6999 | /* Constant: '<S219>/Constant4' */ |
| 7000 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_j, |
| 7001 | L4_MABX_P.Constant4_Value, |
| 7002 | L4_MABX_B.DataTypeConversion2_i, |
| 7003 | &L4_MABX_B.If_Then_Else1_kg); |
| 7004 | |
| 7005 | /* End of Outputs for SubSystem: '<S225>/If_Then_Else1' */ |
| 7006 | |
| 7007 | /* Outputs for Atomic SubSystem: '<S225>/If_Then_Else' */ |
| 7008 | |
| 7009 | /* Constant: '<S219>/Constant2' */ |
| 7010 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_ch, |
| 7011 | L4_MABX_P.Constant2_Value_b, |
| 7012 | L4_MABX_B.If_Then_Else1_kg.Switch, |
| 7013 | &L4_MABX_B.If_Then_Else_bo); |
| 7014 | |
| 7015 | /* End of Outputs for SubSystem: '<S225>/If_Then_Else' */ |
| 7016 | |
| 7017 | /* DataTypeConversion: '<S219>/Data Type Conversion3' */ |
| 7018 | L4_MABX_B.DataTypeConversion3_he = L4_MABX_B.SPN2978_EstEngParasiticLossesPe; |
| 7019 | |
| 7020 | /* RelationalOperator: '<S226>/Relational Operator1' incorporates: |
| 7021 | * Constant: '<S219>/Constant5' |
| 7022 | */ |
| 7023 | L4_MABX_B.RelationalOperator1_ln = (L4_MABX_B.DataTypeConversion3_he >= |
| 7024 | L4_MABX_P.Constant5_Value); |
| 7025 | |
| 7026 | /* RelationalOperator: '<S226>/Relational Operator' incorporates: |
| 7027 | * Constant: '<S219>/Constant6' |
| 7028 | */ |
| 7029 | L4_MABX_B.RelationalOperator_fd = (L4_MABX_B.DataTypeConversion3_he <= |
| 7030 | L4_MABX_P.Constant6_Value); |
| 7031 | |
| 7032 | /* Outputs for Atomic SubSystem: '<S226>/If_Then_Else1' */ |
| 7033 | |
| 7034 | /* Constant: '<S219>/Constant6' */ |
| 7035 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_fd, |
| 7036 | L4_MABX_P.Constant6_Value, |
| 7037 | L4_MABX_B.DataTypeConversion3_he, |
| 7038 | &L4_MABX_B.If_Then_Else1_dz); |
| 7039 | |
| 7040 | /* End of Outputs for SubSystem: '<S226>/If_Then_Else1' */ |
| 7041 | |
| 7042 | /* Outputs for Atomic SubSystem: '<S226>/If_Then_Else' */ |
| 7043 | |
| 7044 | /* Constant: '<S219>/Constant5' */ |
| 7045 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_ln, |
| 7046 | L4_MABX_P.Constant5_Value, |
| 7047 | L4_MABX_B.If_Then_Else1_dz.Switch, |
| 7048 | &L4_MABX_B.If_Then_Else_br); |
| 7049 | |
| 7050 | /* End of Outputs for SubSystem: '<S226>/If_Then_Else' */ |
| 7051 | |
| 7052 | /* DataTypeConversion: '<S223>/Data Type Conversion5' */ |
| 7053 | L4_MABX_B.DataTypeConversion5_i = L4_MABX_B.SFunction1_o1_ag; |
| 7054 | |
| 7055 | /* Lookup_n-D: '<S230>/1-D Lookup Table' */ |
| 7056 | L4_MABX_B.Coeff_of_drag_Cd = look1_binlcapw(L4_MABX_B.DataTypeConversion5_i, |
| 7057 | L4_MABX_P.uDLookupTable_bp01Data, L4_MABX_P.uDLookupTable_tableData, 2U); |
| 7058 | |
| 7059 | /* Gain: '<S230>/KPH_TO_M//S' */ |
| 7060 | L4_MABX_B.KPH_TO_MS = L4_MABX_P.KPH_TO_MS_Gain * |
| 7061 | L4_MABX_B.DataTypeConversion5_i; |
| 7062 | |
| 7063 | /* Math: '<S230>/Math Function' |
| 7064 | * |
| 7065 | * About '<S230>/Math Function': |
| 7066 | * Operator: magnitude^2 |
| 7067 | */ |
| 7068 | PositionFinalLimited = L4_MABX_B.KPH_TO_MS; |
| 7069 | L4_MABX_B.MathFunction = PositionFinalLimited * PositionFinalLimited; |
| 7070 | |
| 7071 | /* DataTypeConversion: '<S223>/Data Type Conversion' */ |
| 7072 | L4_MABX_B.DataTypeConversion_i = L4_MABX_B.SFunction1_o1_ps; |
| 7073 | |
| 7074 | /* Gain: '<S230>/KPA_TO_PA' */ |
| 7075 | L4_MABX_B.KPA_TO_PA = L4_MABX_P.KPA_TO_PA_Gain * |
| 7076 | L4_MABX_B.DataTypeConversion_i; |
| 7077 | |
| 7078 | /* DataTypeConversion: '<S223>/Data Type Conversion4' */ |
| 7079 | L4_MABX_B.DataTypeConversion4_b = L4_MABX_B.SFunction1_o3_b1; |
| 7080 | |
| 7081 | /* Sum: '<S230>/Add' incorporates: |
| 7082 | * Constant: '<S230>/Constant' |
| 7083 | */ |
| 7084 | L4_MABX_B.Add_o = L4_MABX_B.DataTypeConversion4_b + L4_MABX_P.Constant_Value; |
| 7085 | |
| 7086 | /* Product: '<S230>/Product' incorporates: |
| 7087 | * Constant: '<S230>/Constant1' |
| 7088 | */ |
| 7089 | L4_MABX_B.Product_nm = L4_MABX_B.Add_o * L4_MABX_P.Constant1_Value_p; |
| 7090 | |
| 7091 | /* Product: '<S230>/Divide' */ |
| 7092 | L4_MABX_B.Air_density_kgm3 = L4_MABX_B.KPA_TO_PA / L4_MABX_B.Product_nm; |
| 7093 | |
| 7094 | /* Product: '<S230>/Product1' incorporates: |
| 7095 | * Constant: '<S223>/Veh_Frontal_Area_m^2' |
| 7096 | * Constant: '<S230>/Constant2' |
| 7097 | */ |
| 7098 | L4_MABX_B.Aerodynamic_resistance_Ra = L4_MABX_B.Coeff_of_drag_Cd * |
| 7099 | L4_MABX_P.Veh_Frontal_Area_m2_Value * L4_MABX_B.MathFunction * |
| 7100 | L4_MABX_B.Air_density_kgm3 * L4_MABX_P.Constant2_Value_h; |
| 7101 | |
| 7102 | /* DataTypeConversion: '<S223>/Data Type Conversion6' */ |
| 7103 | L4_MABX_B.DataTypeConversion6_fq = L4_MABX_B.PitchAngleExRange; |
| 7104 | |
| 7105 | /* Product: '<S231>/Divide' incorporates: |
| 7106 | * Constant: '<S231>/Constant2' |
| 7107 | * Constant: '<S231>/Constant3' |
| 7108 | */ |
| 7109 | L4_MABX_B.grade_angle_radians = L4_MABX_B.DataTypeConversion6_fq * |
| 7110 | L4_MABX_P.Constant2_Value_bc / L4_MABX_P.Constant3_Value_n; |
| 7111 | |
| 7112 | /* Trigonometry: '<S231>/Trigonometric Function' */ |
| 7113 | L4_MABX_B.TrigonometricFunction_a = sin(L4_MABX_B.grade_angle_radians); |
| 7114 | |
| 7115 | /* Product: '<S231>/Product1' incorporates: |
| 7116 | * Constant: '<S231>/Constant1' |
| 7117 | */ |
| 7118 | L4_MABX_B.Gradient_resistance_Rg = L4_MABX_B.SPN1760_GrossCombinationVehicle |
| 7119 | * L4_MABX_B.TrigonometricFunction_a * L4_MABX_P.Constant1_Value_a; |
| 7120 | |
| 7121 | /* Gain: '<S234>/KPA_TO_M//S' */ |
| 7122 | L4_MABX_B.KPA_TO_MS = L4_MABX_P.KPA_TO_MS_Gain * |
| 7123 | L4_MABX_B.DataTypeConversion5_i; |
| 7124 | |
| 7125 | /* Product: '<S234>/Divide2' incorporates: |
| 7126 | * Constant: '<S234>/Constant2' |
| 7127 | * Constant: '<S234>/Constant6' |
| 7128 | */ |
| 7129 | L4_MABX_B.Divide2_c = L4_MABX_P.Constant2_Value_bq * L4_MABX_B.KPA_TO_MS / |
| 7130 | L4_MABX_P.Constant6_Value_g; |
| 7131 | |
| 7132 | /* Math: '<S234>/Math Function' |
| 7133 | * |
| 7134 | * About '<S234>/Math Function': |
| 7135 | * Operator: magnitude^2 |
| 7136 | */ |
| 7137 | PositionFinalLimited = L4_MABX_B.Divide2_c; |
| 7138 | L4_MABX_B.MathFunction_l = PositionFinalLimited * PositionFinalLimited; |
| 7139 | |
| 7140 | /* Sum: '<S234>/Add' incorporates: |
| 7141 | * Constant: '<S234>/Constant1' |
| 7142 | */ |
| 7143 | L4_MABX_B.Add_nj = L4_MABX_P.Constant1_Value_m + L4_MABX_B.MathFunction_l; |
| 7144 | |
| 7145 | /* Outputs for Atomic SubSystem: '<S228>/If_Then_Else' */ |
| 7146 | |
| 7147 | /* Constant: '<S223>/TIRE1_tire_pressure' incorporates: |
| 7148 | * Constant: '<S228>/Truck166_tire_pressure' |
| 7149 | */ |
| 7150 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_e, |
| 7151 | L4_MABX_P.TIRE1_tire_pressure_Value, |
| 7152 | L4_MABX_P.Truck166_tire_pressure_Value, |
| 7153 | &L4_MABX_B.If_Then_Else_nr); |
| 7154 | |
| 7155 | /* End of Outputs for SubSystem: '<S228>/If_Then_Else' */ |
| 7156 | |
| 7157 | /* Gain: '<S234>/KPA_TO_BAR' */ |
| 7158 | L4_MABX_B.KPA_TO_BAR = L4_MABX_P.KPA_TO_BAR_Gain * |
| 7159 | L4_MABX_B.If_Then_Else_nr.Switch; |
| 7160 | |
| 7161 | /* Product: '<S234>/Divide' */ |
| 7162 | L4_MABX_B.Divide_k = L4_MABX_B.Add_nj / L4_MABX_B.KPA_TO_BAR; |
| 7163 | |
| 7164 | /* Sum: '<S234>/Add1' incorporates: |
| 7165 | * Constant: '<S234>/Constant' |
| 7166 | */ |
| 7167 | L4_MABX_B.Coeff_of_rolling_resistance_Cr = L4_MABX_P.Constant_Value_h + |
| 7168 | L4_MABX_B.Divide_k; |
| 7169 | |
| 7170 | /* Product: '<S232>/Divide1' incorporates: |
| 7171 | * Constant: '<S232>/Constant4' |
| 7172 | * Constant: '<S232>/Constant5' |
| 7173 | */ |
| 7174 | L4_MABX_B.grade_angle_radians_a = L4_MABX_B.DataTypeConversion6_fq * |
| 7175 | L4_MABX_P.Constant4_Value_o / L4_MABX_P.Constant5_Value_p; |
| 7176 | |
| 7177 | /* Trigonometry: '<S232>/Trigonometric Function' */ |
| 7178 | L4_MABX_B.TrigonometricFunction_e = cos(L4_MABX_B.grade_angle_radians_a); |
| 7179 | |
| 7180 | /* Product: '<S232>/Product2' incorporates: |
| 7181 | * Constant: '<S232>/Constant3' |
| 7182 | */ |
| 7183 | L4_MABX_B.Rolling_resistance_Rr = L4_MABX_B.Coeff_of_rolling_resistance_Cr * |
| 7184 | L4_MABX_B.SPN1760_GrossCombinationVehicle * |
| 7185 | L4_MABX_B.TrigonometricFunction_e * L4_MABX_P.Constant3_Value_p; |
| 7186 | |
| 7187 | /* Sum: '<S228>/Add' incorporates: |
| 7188 | * Constant: '<S228>/Constant' |
| 7189 | */ |
| 7190 | L4_MABX_B.TotalTractiveForce_N = ((L4_MABX_B.Aerodynamic_resistance_Ra + |
| 7191 | L4_MABX_B.Gradient_resistance_Rg) + L4_MABX_B.Rolling_resistance_Rr) + |
| 7192 | L4_MABX_P.Constant_Value_g; |
| 7193 | |
| 7194 | /* Saturate: '<S223>/Saturation' */ |
| 7195 | DeltaTime = L4_MABX_B.SPN526_TransActualGearRatio; |
| 7196 | Time56 = L4_MABX_P.Saturation_LowerSat_p; |
| 7197 | PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_n; |
| 7198 | if (DeltaTime > PositionFinalLimited) { |
| 7199 | L4_MABX_B.Saturation_g = PositionFinalLimited; |
| 7200 | } else if (DeltaTime < Time56) { |
| 7201 | L4_MABX_B.Saturation_g = Time56; |
| 7202 | } else { |
| 7203 | L4_MABX_B.Saturation_g = DeltaTime; |
| 7204 | } |
| 7205 | |
| 7206 | /* End of Saturate: '<S223>/Saturation' */ |
| 7207 | |
| 7208 | /* MATLAB Function: '<S223>/F_wheel_to_Tq_eng' incorporates: |
| 7209 | * Constant: '<S223>/N_rar' |
| 7210 | * Constant: '<S223>/R_wheel_m' |
| 7211 | * Constant: '<S223>/eta' |
| 7212 | */ |
| 7213 | /* MATLAB Function 'STATE_CONTROL_10ms/Throttle_controller_gov/Determine_engine_torque_and_losses/CalculateRoadLoadTorque/F_wheel_to_Tq_eng': '<S229>:1' */ |
| 7214 | /* '<S229>:1:3' */ |
| 7215 | L4_MABX_B.road_load_tq = L4_MABX_B.TotalTractiveForce_N * |
| 7216 | L4_MABX_P.R_wheel_m_Value / L4_MABX_P.N_rar_Value / L4_MABX_B.Saturation_g |
| 7217 | / L4_MABX_P.eta_Value; |
| 7218 | |
| 7219 | /* DataTypeConversion: '<S223>/Data Type Conversion1' */ |
| 7220 | L4_MABX_B.DataTypeConversion1_be = L4_MABX_B.SPN544_EngineReferenceTorque; |
| 7221 | |
| 7222 | /* Product: '<S223>/Divide' */ |
| 7223 | L4_MABX_B.RoadLoadTorque_fract = L4_MABX_B.road_load_tq / |
| 7224 | L4_MABX_B.DataTypeConversion1_be; |
| 7225 | |
| 7226 | /* Gain: '<S223>/Gain' */ |
| 7227 | L4_MABX_B.RoadLoadTorque_pct = L4_MABX_P.Gain_Gain_n * |
| 7228 | L4_MABX_B.RoadLoadTorque_fract; |
| 7229 | |
| 7230 | /* Outputs for Atomic SubSystem: '<S219>/If_Then_Else' */ |
| 7231 | |
| 7232 | /* Constant: '<S219>/UseFeedForwardRoadLoad' incorporates: |
| 7233 | * Constant: '<S219>/ZeroRoadLoadCPV' |
| 7234 | */ |
| 7235 | L4_MABX_If_Then_Else(L4_MABX_P.UseFeedForwardRoadLoad_Value, |
| 7236 | L4_MABX_B.RoadLoadTorque_pct, |
| 7237 | L4_MABX_P.ZeroRoadLoadCPV_Value, |
| 7238 | &L4_MABX_B.If_Then_Else_as); |
| 7239 | |
| 7240 | /* End of Outputs for SubSystem: '<S219>/If_Then_Else' */ |
| 7241 | |
| 7242 | /* Sum: '<S219>/Add1' */ |
| 7243 | L4_MABX_B.FeedForwardTorque_pct = (L4_MABX_B.If_Then_Else_bo.Switch + |
| 7244 | L4_MABX_B.If_Then_Else_br.Switch) + L4_MABX_B.If_Then_Else_as.Switch; |
| 7245 | |
| 7246 | /* UnitDelay: '<S220>/Unit_Delay1' */ |
| 7247 | L4_MABX_B.Unit_Delay1_m5 = L4_MABX_DW.Unit_Delay1_DSTATE_p1; |
| 7248 | |
| 7249 | /* Logic: '<S220>/Logical Operator' incorporates: |
| 7250 | * Constant: '<S220>/Constant1' |
| 7251 | */ |
| 7252 | L4_MABX_B.f_gpid_reset = (L4_MABX_P.Constant1_Value_g1 || |
| 7253 | L4_MABX_B.Unit_Delay1_m5); |
| 7254 | |
| 7255 | /* Sum: '<S220>/Subtract' */ |
| 7256 | L4_MABX_B.Subtract_f = L4_MABX_B.VSPD_TARGET_KPH_APV_g - |
| 7257 | L4_MABX_B.VSPD_HYST_KPH_APV_f; |
| 7258 | |
| 7259 | /* RelationalOperator: '<S220>/Relational Operator' */ |
| 7260 | L4_MABX_B.RelationalOperator_fl = (L4_MABX_B.DataTypeConversion4_ib > |
| 7261 | L4_MABX_B.Subtract_f); |
| 7262 | |
| 7263 | /* UnitDelay: '<S220>/Unit_Delay' */ |
| 7264 | L4_MABX_B.Unit_Delay_d5 = L4_MABX_DW.Unit_Delay_DSTATE_lqi; |
| 7265 | |
| 7266 | /* RelationalOperator: '<S220>/Relational Operator1' */ |
| 7267 | L4_MABX_B.RelationalOperator1_d = (L4_MABX_B.RelationalOperator_fl != |
| 7268 | L4_MABX_B.Unit_Delay_d5); |
| 7269 | |
| 7270 | /* Lookup_n-D: '<S241>/2D_Lookup_Table' */ |
| 7271 | L4_MABX_B.uD_Lookup_Table_am = look2_binlcapw |
| 7272 | (L4_MABX_B.SPN1760_GrossCombinationVehicle, |
| 7273 | L4_MABX_B.SPN526_TransActualGearRatio, TQ_DEM_MASS_STEP_MPV, |
| 7274 | TQ_DEM_GEAR_RATIO_STEP_MPV, TQ_DEM_KP_DATA_MPV, |
| 7275 | L4_MABX_P.uD_Lookup_Table_maxIndex, 8U); |
| 7276 | |
| 7277 | /* Lookup_n-D: '<S242>/2D_Lookup_Table' */ |
| 7278 | L4_MABX_B.uD_Lookup_Table_o = look2_binlcapw |
| 7279 | (L4_MABX_B.SPN1760_GrossCombinationVehicle, |
| 7280 | L4_MABX_B.SPN526_TransActualGearRatio, TQ_DEM_MASS_STEP_MPV, |
| 7281 | TQ_DEM_GEAR_RATIO_STEP_MPV, TQ_DEM_KI_DATA_MPV, |
| 7282 | L4_MABX_P.uD_Lookup_Table_maxIndex_p, 8U); |
| 7283 | |
| 7284 | /* Lookup_n-D: '<S243>/2D_Lookup_Table' */ |
| 7285 | L4_MABX_B.uD_Lookup_Table_h = look2_binlcapw |
| 7286 | (L4_MABX_B.SPN1760_GrossCombinationVehicle, |
| 7287 | L4_MABX_B.SPN526_TransActualGearRatio, TQ_DEM_MASS_STEP_MPV, |
| 7288 | TQ_DEM_GEAR_RATIO_STEP_MPV, TQ_DEM_KD_DATA_MPV, |
| 7289 | L4_MABX_P.uD_Lookup_Table_maxIndex_a, 8U); |
| 7290 | |
| 7291 | /* Abs: '<S244>/Abs' */ |
| 7292 | L4_MABX_B.Abs_igm = fabs(L4_MABX_B.uD_Lookup_Table_o); |
| 7293 | |
| 7294 | /* Abs: '<S244>/Abs1' */ |
| 7295 | L4_MABX_B.Abs1_a = fabs(L4_MABX_B.uD_Lookup_Table_h); |
| 7296 | |
| 7297 | /* UnitDelay: '<S247>/Unit_Delay' */ |
| 7298 | L4_MABX_B.Unit_Delay_i0 = L4_MABX_DW.Unit_Delay_DSTATE_be; |
| 7299 | |
| 7300 | /* Logic: '<S247>/Logical Operator1' */ |
| 7301 | L4_MABX_B.LogicalOperator1_ob = (L4_MABX_B.Unit_Delay_i0 || |
| 7302 | L4_MABX_B.f_gpid_reset); |
| 7303 | |
| 7304 | /* UnitDelay: '<S267>/Unit_Delay1' */ |
| 7305 | L4_MABX_B.Unit_Delay1_dw = L4_MABX_DW.Unit_Delay1_DSTATE_h; |
| 7306 | |
| 7307 | /* Logic: '<S267>/Logical Operator' */ |
| 7308 | L4_MABX_B.LogicalOperator_at = (L4_MABX_B.LogicalOperator1_ob || |
| 7309 | L4_MABX_B.Unit_Delay1_dw); |
| 7310 | |
| 7311 | /* UnitDelay: '<S268>/Unit_Delay' */ |
| 7312 | L4_MABX_B.Unit_Delay_ne = L4_MABX_DW.Unit_Delay_DSTATE_fi; |
| 7313 | |
| 7314 | /* Logic: '<S268>/Logical Operator1' */ |
| 7315 | L4_MABX_B.LogicalOperator1_kz = (L4_MABX_B.LogicalOperator1_ob || |
| 7316 | L4_MABX_B.Unit_Delay_ne); |
| 7317 | |
| 7318 | /* UnitDelay: '<S272>/FixPt Unit Delay2' */ |
| 7319 | L4_MABX_B.FixPtUnitDelay2_a = L4_MABX_DW.FixPtUnitDelay2_DSTATE_gq; |
| 7320 | |
| 7321 | /* UnitDelay: '<S272>/FixPt Unit Delay1' */ |
| 7322 | L4_MABX_B.Xold_a = L4_MABX_DW.FixPtUnitDelay1_DSTATE_a; |
| 7323 | |
| 7324 | /* Switch: '<S272>/Init' */ |
| 7325 | if (L4_MABX_B.FixPtUnitDelay2_a != 0) { |
| 7326 | L4_MABX_B.Init_pu = L4_MABX_B.VSPD_TARGET_KPH_APV_g; |
| 7327 | } else { |
| 7328 | L4_MABX_B.Init_pu = L4_MABX_B.Xold_a; |
| 7329 | } |
| 7330 | |
| 7331 | /* End of Switch: '<S272>/Init' */ |
| 7332 | |
| 7333 | /* Abs: '<S268>/Abs' incorporates: |
| 7334 | * Constant: '<S212>/TqDemSlewInc' |
| 7335 | */ |
| 7336 | L4_MABX_B.Abs_n = fabs(L4_MABX_P.TqDemSlewInc_Value); |
| 7337 | |
| 7338 | /* Product: '<S268>/Product1' incorporates: |
| 7339 | * Constant: '<S212>/TqDemDt' |
| 7340 | */ |
| 7341 | L4_MABX_B.Product1_g = L4_MABX_B.Abs_n * L4_MABX_P.TqDemDt_Value; |
| 7342 | |
| 7343 | /* Sum: '<S268>/Add1' */ |
| 7344 | L4_MABX_B.Add1_g = L4_MABX_B.Init_pu + L4_MABX_B.Product1_g; |
| 7345 | |
| 7346 | /* MinMax: '<S268>/MinMax2' */ |
| 7347 | DeltaTime = L4_MABX_B.VSPD_TARGET_KPH_APV_g; |
| 7348 | PositionFinalLimited = L4_MABX_B.Add1_g; |
| 7349 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 7350 | PositionFinalLimited = DeltaTime; |
| 7351 | } |
| 7352 | |
| 7353 | L4_MABX_B.MinMax2_n = PositionFinalLimited; |
| 7354 | |
| 7355 | /* End of MinMax: '<S268>/MinMax2' */ |
| 7356 | |
| 7357 | /* Abs: '<S268>/Abs1' incorporates: |
| 7358 | * Constant: '<S212>/TqDemSlewDec' |
| 7359 | */ |
| 7360 | L4_MABX_B.Abs1_d = fabs(L4_MABX_P.TqDemSlewDec_Value); |
| 7361 | |
| 7362 | /* Product: '<S268>/Product2' incorporates: |
| 7363 | * Constant: '<S212>/TqDemDt' |
| 7364 | */ |
| 7365 | L4_MABX_B.Product2_bn = L4_MABX_P.TqDemDt_Value * L4_MABX_B.Abs1_d; |
| 7366 | |
| 7367 | /* Sum: '<S268>/Subtract1' */ |
| 7368 | L4_MABX_B.Subtract1_o = L4_MABX_B.Init_pu - L4_MABX_B.Product2_bn; |
| 7369 | |
| 7370 | /* MinMax: '<S268>/MinMax1' */ |
| 7371 | DeltaTime = L4_MABX_B.MinMax2_n; |
| 7372 | PositionFinalLimited = L4_MABX_B.Subtract1_o; |
| 7373 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 7374 | PositionFinalLimited = DeltaTime; |
| 7375 | } |
| 7376 | |
| 7377 | L4_MABX_B.MinMax1_g = PositionFinalLimited; |
| 7378 | |
| 7379 | /* End of MinMax: '<S268>/MinMax1' */ |
| 7380 | |
| 7381 | /* Outputs for Atomic SubSystem: '<S268>/If_Then_Else' */ |
| 7382 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_kz, |
| 7383 | L4_MABX_B.DataTypeConversion4_ib, L4_MABX_B.MinMax1_g, |
| 7384 | &L4_MABX_B.If_Then_Else_cp); |
| 7385 | |
| 7386 | /* End of Outputs for SubSystem: '<S268>/If_Then_Else' */ |
| 7387 | |
| 7388 | /* Sum: '<S245>/Subtract' */ |
| 7389 | L4_MABX_B.Subtract_jb = L4_MABX_B.If_Then_Else_cp.Switch - |
| 7390 | L4_MABX_B.DataTypeConversion4_ib; |
| 7391 | |
| 7392 | /* MinMax: '<S267>/MinMax1' incorporates: |
| 7393 | * Constant: '<S212>/TqDemDt' |
| 7394 | * Constant: '<S212>/TqDemTFildCtrlErrorSecs' |
| 7395 | */ |
| 7396 | DeltaTime = L4_MABX_P.TqDemDt_Value; |
| 7397 | PositionFinalLimited = L4_MABX_P.TqDemTFildCtrlErrorSecs_Value; |
| 7398 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 7399 | PositionFinalLimited = DeltaTime; |
| 7400 | } |
| 7401 | |
| 7402 | L4_MABX_B.MinMax1_dx = PositionFinalLimited; |
| 7403 | |
| 7404 | /* End of MinMax: '<S267>/MinMax1' */ |
| 7405 | |
| 7406 | /* Saturate: '<S267>/Saturation' */ |
| 7407 | DeltaTime = L4_MABX_B.MinMax1_dx; |
| 7408 | Time56 = L4_MABX_P.Saturation_LowerSat_g5; |
| 7409 | PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_f; |
| 7410 | if (DeltaTime > PositionFinalLimited) { |
| 7411 | L4_MABX_B.Saturation_dy = PositionFinalLimited; |
| 7412 | } else if (DeltaTime < Time56) { |
| 7413 | L4_MABX_B.Saturation_dy = Time56; |
| 7414 | } else { |
| 7415 | L4_MABX_B.Saturation_dy = DeltaTime; |
| 7416 | } |
| 7417 | |
| 7418 | /* End of Saturate: '<S267>/Saturation' */ |
| 7419 | |
| 7420 | /* Product: '<S267>/Divide' incorporates: |
| 7421 | * Constant: '<S212>/TqDemDt' |
| 7422 | */ |
| 7423 | L4_MABX_B.Divide_n = L4_MABX_P.TqDemDt_Value / L4_MABX_B.Saturation_dy; |
| 7424 | |
| 7425 | /* Product: '<S267>/Product2' */ |
| 7426 | L4_MABX_B.Product2_l = L4_MABX_B.Subtract_jb * L4_MABX_B.Divide_n; |
| 7427 | |
| 7428 | /* Sum: '<S267>/Subtract1' incorporates: |
| 7429 | * Constant: '<S267>/Constant1' |
| 7430 | */ |
| 7431 | L4_MABX_B.Subtract1_k = L4_MABX_P.Constant1_Value_ci - L4_MABX_B.Divide_n; |
| 7432 | |
| 7433 | /* UnitDelay: '<S267>/Unit_Delay2' */ |
| 7434 | L4_MABX_B.Unit_Delay2_o = L4_MABX_DW.Unit_Delay2_DSTATE_mh; |
| 7435 | |
| 7436 | /* Product: '<S267>/Product1' */ |
| 7437 | L4_MABX_B.Product1_p = L4_MABX_B.Subtract1_k * L4_MABX_B.Unit_Delay2_o; |
| 7438 | |
| 7439 | /* Sum: '<S267>/Add1' */ |
| 7440 | L4_MABX_B.Add1_i = L4_MABX_B.Product2_l + L4_MABX_B.Product1_p; |
| 7441 | |
| 7442 | /* Outputs for Atomic SubSystem: '<S267>/If_Then_Else' */ |
| 7443 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_at, L4_MABX_B.Subtract_jb, |
| 7444 | L4_MABX_B.Add1_i, &L4_MABX_B.If_Then_Else_k2t); |
| 7445 | |
| 7446 | /* End of Outputs for SubSystem: '<S267>/If_Then_Else' */ |
| 7447 | |
| 7448 | /* RelationalOperator: '<S252>/Compare' incorporates: |
| 7449 | * Constant: '<S252>/Constant' |
| 7450 | */ |
| 7451 | L4_MABX_B.Compare_goa = (L4_MABX_B.Abs1_a > |
| 7452 | L4_MABX_P.CompareToConstant1_const_i); |
| 7453 | |
| 7454 | /* Outputs for Enabled SubSystem: '<S244>/Calculate_D_term' */ |
| 7455 | |
| 7456 | /* Constant: '<S212>/TqDemDt' incorporates: |
| 7457 | * Constant: '<S212>/TqDemTFildTSecs' |
| 7458 | */ |
| 7459 | L4_MABX_Calculate_D_term(L4_MABX_B.Compare_goa, L4_MABX_B.uD_Lookup_Table_h, |
| 7460 | L4_MABX_P.TqDemDt_Value, L4_MABX_B.LogicalOperator1_ob, |
| 7461 | L4_MABX_B.If_Then_Else_k2t.Switch, L4_MABX_P.TqDemTFildTSecs_Value, |
| 7462 | &L4_MABX_B.Calculate_D_term_h, &L4_MABX_DW.Calculate_D_term_h, |
| 7463 | &L4_MABX_P.Calculate_D_term_h); |
| 7464 | |
| 7465 | /* End of Outputs for SubSystem: '<S244>/Calculate_D_term' */ |
| 7466 | |
| 7467 | /* Product: '<S250>/Product' */ |
| 7468 | L4_MABX_B.Product_i = L4_MABX_B.uD_Lookup_Table_am * |
| 7469 | L4_MABX_B.If_Then_Else_k2t.Switch; |
| 7470 | |
| 7471 | /* RelationalOperator: '<S212>/Relational Operator' */ |
| 7472 | L4_MABX_B.RelationalOperator_ao = (L4_MABX_B.SPN524_TransSelectedGear != |
| 7473 | L4_MABX_B.SPN523_TransCurrentGear); |
| 7474 | |
| 7475 | /* UnitDelay: '<S222>/Unit_Delay' */ |
| 7476 | L4_MABX_B.Unit_Delay_m4 = L4_MABX_DW.Unit_Delay_DSTATE_fz; |
| 7477 | |
| 7478 | /* RelationalOperator: '<S251>/Compare' incorporates: |
| 7479 | * Constant: '<S251>/Constant' |
| 7480 | */ |
| 7481 | L4_MABX_B.Compare_pj = (L4_MABX_B.Abs_igm > |
| 7482 | L4_MABX_P.CompareToConstant_const_d); |
| 7483 | |
| 7484 | /* Outputs for Enabled SubSystem: '<S244>/Calculate_I_term' */ |
| 7485 | |
| 7486 | /* Constant: '<S212>/TqDemDt' incorporates: |
| 7487 | * Constant: '<S212>/GpidAwCondIntegration' |
| 7488 | * Constant: '<S212>/TqDemAwHyst' |
| 7489 | */ |
| 7490 | L4_MABX_Calculate_I_term(L4_MABX_B.Compare_pj, L4_MABX_B.Product_i, |
| 7491 | L4_MABX_B.uD_Lookup_Table_o, L4_MABX_B.If_Then_Else_ct.Switch, |
| 7492 | L4_MABX_B.If_Then_Else_k2t.Switch, L4_MABX_B.LogicalOperator1_ob, |
| 7493 | L4_MABX_P.TqDemDt_Value, L4_MABX_B.FeedForwardTorque_pct, |
| 7494 | L4_MABX_P.GpidAwCondIntegration_Value, L4_MABX_P.TqDemAwHyst_Value, |
| 7495 | L4_MABX_B.RelationalOperator_ao, L4_MABX_B.Unit_Delay_m4, |
| 7496 | &L4_MABX_B.Calculate_I_term_n, &L4_MABX_DW.Calculate_I_term_n, |
| 7497 | &L4_MABX_P.Calculate_I_term_n); |
| 7498 | |
| 7499 | /* End of Outputs for SubSystem: '<S244>/Calculate_I_term' */ |
| 7500 | |
| 7501 | /* RelationalOperator: '<S270>/min_relop' incorporates: |
| 7502 | * Constant: '<S212>/TqDemSlewInc' |
| 7503 | * Constant: '<S270>/min_val' |
| 7504 | */ |
| 7505 | L4_MABX_B.min_relop_cbm = (L4_MABX_P.CheckStaticLowerBound_min_b <= |
| 7506 | L4_MABX_P.TqDemSlewInc_Value); |
| 7507 | |
| 7508 | /* Assertion: '<S270>/Assertion' */ |
| 7509 | utAssert(L4_MABX_B.min_relop_cbm); |
| 7510 | |
| 7511 | /* Sum: '<S246>/Add' */ |
| 7512 | L4_MABX_B.Add_ds = ((L4_MABX_B.Product_i + |
| 7513 | L4_MABX_B.Calculate_I_term_n.If_Then_Else.Switch) + |
| 7514 | L4_MABX_B.Calculate_D_term_h.Subtract) + |
| 7515 | L4_MABX_B.FeedForwardTorque_pct; |
| 7516 | |
| 7517 | /* RelationalOperator: '<S273>/Relational Operator1' incorporates: |
| 7518 | * Constant: '<S212>/TqDemLimMax' |
| 7519 | */ |
| 7520 | L4_MABX_B.RelationalOperator1_ja = (L4_MABX_B.Add_ds >= |
| 7521 | L4_MABX_P.TqDemLimMax_Value); |
| 7522 | |
| 7523 | /* RelationalOperator: '<S273>/Relational Operator' incorporates: |
| 7524 | * Constant: '<S212>/TqDemLimMin' |
| 7525 | */ |
| 7526 | L4_MABX_B.RelationalOperator_p = (L4_MABX_B.Add_ds <= |
| 7527 | L4_MABX_P.TqDemLimMin_Value); |
| 7528 | |
| 7529 | /* Outputs for Atomic SubSystem: '<S273>/If_Then_Else1' */ |
| 7530 | |
| 7531 | /* Constant: '<S212>/TqDemLimMin' */ |
| 7532 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_p, |
| 7533 | L4_MABX_P.TqDemLimMin_Value, L4_MABX_B.Add_ds, |
| 7534 | &L4_MABX_B.If_Then_Else1_h3); |
| 7535 | |
| 7536 | /* End of Outputs for SubSystem: '<S273>/If_Then_Else1' */ |
| 7537 | |
| 7538 | /* Outputs for Atomic SubSystem: '<S273>/If_Then_Else' */ |
| 7539 | |
| 7540 | /* Constant: '<S212>/TqDemLimMax' */ |
| 7541 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_ja, |
| 7542 | L4_MABX_P.TqDemLimMax_Value, |
| 7543 | L4_MABX_B.If_Then_Else1_h3.Switch, |
| 7544 | &L4_MABX_B.If_Then_Else_pi); |
| 7545 | |
| 7546 | /* End of Outputs for SubSystem: '<S273>/If_Then_Else' */ |
| 7547 | |
| 7548 | /* SignalConversion: '<S212>/OutportBufferForPID_d_term' */ |
| 7549 | L4_MABX_B.PID_d_term_c = L4_MABX_B.Calculate_D_term_h.Subtract; |
| 7550 | |
| 7551 | /* SignalConversion: '<S212>/OutportBufferForPID_hold_i_term_f' */ |
| 7552 | L4_MABX_B.PID_hold_i_term_f_b = |
| 7553 | L4_MABX_B.Calculate_I_term_n.LogicalOperator2; |
| 7554 | |
| 7555 | /* SignalConversion: '<S212>/OutportBufferForPID_i_term' */ |
| 7556 | L4_MABX_B.PID_i_term_c = L4_MABX_B.Calculate_I_term_n.If_Then_Else.Switch; |
| 7557 | } else { |
| 7558 | if (L4_MABX_DW.Throttle_controller_gov_MODE) { |
| 7559 | /* Disable for Enabled SubSystem: '<S244>/Calculate_D_term' */ |
| 7560 | if (L4_MABX_DW.Calculate_D_term_h.Calculate_D_term_MODE) { |
| 7561 | L4_Calculate_D_term_Disable(&L4_MABX_B.Calculate_D_term_h, |
| 7562 | &L4_MABX_DW.Calculate_D_term_h, &L4_MABX_P.Calculate_D_term_h); |
| 7563 | } |
| 7564 | |
| 7565 | /* End of Disable for SubSystem: '<S244>/Calculate_D_term' */ |
| 7566 | |
| 7567 | /* Disable for Enabled SubSystem: '<S244>/Calculate_I_term' */ |
| 7568 | if (L4_MABX_DW.Calculate_I_term_n.Calculate_I_term_MODE) { |
| 7569 | L4_Calculate_I_term_Disable(&L4_MABX_B.Calculate_I_term_n, |
| 7570 | &L4_MABX_DW.Calculate_I_term_n, &L4_MABX_P.Calculate_I_term_n); |
| 7571 | } |
| 7572 | |
| 7573 | /* End of Disable for SubSystem: '<S244>/Calculate_I_term' */ |
| 7574 | |
| 7575 | /* Disable for Outport: '<S212>/PID_output' */ |
| 7576 | L4_MABX_B.If_Then_Else_pi.Switch = L4_MABX_P.PID_output_Y0_c; |
| 7577 | |
| 7578 | /* Disable for Outport: '<S212>/PID_output_unlim' */ |
| 7579 | L4_MABX_B.Add_ds = L4_MABX_P.PID_output_unlim_Y0; |
| 7580 | |
| 7581 | /* Disable for Outport: '<S212>/PID_control_error' */ |
| 7582 | L4_MABX_B.If_Then_Else_k2t.Switch = L4_MABX_P.PID_control_error_Y0; |
| 7583 | |
| 7584 | /* Disable for Outport: '<S212>/PID_p_term' */ |
| 7585 | L4_MABX_B.Product_i = L4_MABX_P.PID_p_term_Y0; |
| 7586 | |
| 7587 | /* Disable for Outport: '<S212>/PID_i_term' */ |
| 7588 | L4_MABX_B.PID_i_term_c = L4_MABX_P.PID_i_term_Y0; |
| 7589 | |
| 7590 | /* Disable for Outport: '<S212>/PID_d_term' */ |
| 7591 | L4_MABX_B.PID_d_term_c = L4_MABX_P.PID_d_term_Y0; |
| 7592 | |
| 7593 | /* Disable for Outport: '<S212>/PID_hold_i_term_f' */ |
| 7594 | L4_MABX_B.PID_hold_i_term_f_b = L4_MABX_P.PID_hold_i_term_f_Y0; |
| 7595 | L4_MABX_DW.Throttle_controller_gov_MODE = false; |
| 7596 | } |
| 7597 | } |
| 7598 | |
| 7599 | /* End of Outputs for SubSystem: '<S79>/Throttle_controller_gov' */ |
| 7600 | |
| 7601 | /* Switch: '<S79>/Switch' incorporates: |
| 7602 | * Constant: '<S79>/Constant3' |
| 7603 | */ |
| 7604 | if (L4_MABX_B.F_Brake_control_active) { |
| 7605 | L4_MABX_B.ThrottlePID_Y_m = L4_MABX_P.Constant3_Value; |
| 7606 | } else { |
| 7607 | /* DataTypeConversion: '<S79>/Data Type Conversion3' */ |
| 7608 | L4_MABX_B.DataTypeConversion3_m = L4_MABX_B.SPN544_EngineReferenceTorque; |
| 7609 | |
| 7610 | /* Product: '<S79>/Product' incorporates: |
| 7611 | * Constant: '<S79>/Constant2' |
| 7612 | */ |
| 7613 | L4_MABX_B.ThrottlePID_Y_c = L4_MABX_B.If_Then_Else_pi.Switch * |
| 7614 | L4_MABX_B.DataTypeConversion3_m * L4_MABX_P.Constant2_Value; |
| 7615 | L4_MABX_B.ThrottlePID_Y_m = L4_MABX_B.ThrottlePID_Y_c; |
| 7616 | } |
| 7617 | |
| 7618 | /* End of Switch: '<S79>/Switch' */ |
| 7619 | |
| 7620 | /* MultiPortSwitch: '<S83>/Multiport Switch' incorporates: |
| 7621 | * Constant: '<S83>/APTC_DISABLED_PEDAL_POSITION_APV' |
| 7622 | * Constant: '<S83>/APTC_PEDAL_POS_SIG_SOURCE_APV' |
| 7623 | */ |
| 7624 | switch (L4_MABX_P.APTC_PEDAL_POS_SIG_SOURCE_APV_V) { |
| 7625 | case ENUM_PEDAL_POS_SIGNAL_SOURCE_T_DISABLED: |
| 7626 | L4_MABX_B.MultiportSwitch = L4_MABX_P.APTC_DISABLED_PEDAL_POSITION_AP; |
| 7627 | break; |
| 7628 | |
| 7629 | case ENUM_PEDAL_POS_SIGNAL_SOURCE_T_CAN_EEC2_00: |
| 7630 | L4_MABX_B.MultiportSwitch = L4_MABX_B.uDLookupTable; |
| 7631 | break; |
| 7632 | |
| 7633 | case ENUM_PEDAL_POS_SIGNAL_SOURCE_T_SW_EMULATION: |
| 7634 | L4_MABX_B.MultiportSwitch = L4_MABX_B.ThrottlePID_Y_m; |
| 7635 | break; |
| 7636 | |
| 7637 | case ENUM_PEDAL_POS_SIGNAL_SOURCE_T_CAN_EEC2_00_AND_SW_EMULATION: |
| 7638 | /* MinMax: '<S83>/MinMax' */ |
| 7639 | DeltaTime = L4_MABX_B.uDLookupTable; |
| 7640 | PositionFinalLimited = L4_MABX_B.ThrottlePID_Y_m; |
| 7641 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 7642 | PositionFinalLimited = DeltaTime; |
| 7643 | } |
| 7644 | |
| 7645 | L4_MABX_B.MinMax_p = PositionFinalLimited; |
| 7646 | |
| 7647 | /* End of MinMax: '<S83>/MinMax' */ |
| 7648 | L4_MABX_B.MultiportSwitch = L4_MABX_B.MinMax_p; |
| 7649 | break; |
| 7650 | |
| 7651 | default: |
| 7652 | L4_MABX_B.MultiportSwitch = L4_MABX_P.APTC_DISABLED_PEDAL_POSITION_AP; |
| 7653 | break; |
| 7654 | } |
| 7655 | |
| 7656 | /* End of MultiPortSwitch: '<S83>/Multiport Switch' */ |
| 7657 | |
| 7658 | /* Outputs for Atomic SubSystem: '<S83>/If_Then_Else1' */ |
| 7659 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_d, L4_MABX_B.uDLookupTable, |
| 7660 | L4_MABX_B.MultiportSwitch, &L4_MABX_B.If_Then_Else1_l); |
| 7661 | |
| 7662 | /* End of Outputs for SubSystem: '<S83>/If_Then_Else1' */ |
| 7663 | |
| 7664 | /* DataTypeConversion: '<S82>/Data Type Conversion1' */ |
| 7665 | L4_MABX_B.DataTypeConversion1_n = L4_MABX_B.SFunction1_o5_l; |
| 7666 | |
| 7667 | /* Lookup_n-D: '<S85>/2D_Lookup_Table' */ |
| 7668 | L4_MABX_B.uD_Lookup_Table = look2_binlcapw(L4_MABX_B.If_Then_Else1_l.Switch, |
| 7669 | L4_MABX_B.DataTypeConversion1_n, APTC_TRQ_PED_INV_MAP_TRQ_STEPS, |
| 7670 | APTC_TRQ_PED_TRQ_ESPD_STEP_MPV, APTC_TRQ_PED_INV_MAP_PED_POS_MPV, |
| 7671 | L4_MABX_P.uD_Lookup_Table_maxIndex_h, 83U); |
| 7672 | |
| 7673 | /* Logic: '<S82>/Logical Operator' */ |
| 7674 | L4_MABX_B.LogicalOperator_j2 = !AutonomousEnabled; |
| 7675 | |
| 7676 | /* Outputs for Atomic SubSystem: '<S82>/If_Then_Else' */ |
| 7677 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_j2, Pedal_pwm_position, |
| 7678 | L4_MABX_B.uD_Lookup_Table, &L4_MABX_B.If_Then_Else_f); |
| 7679 | |
| 7680 | /* End of Outputs for SubSystem: '<S82>/If_Then_Else' */ |
| 7681 | |
| 7682 | /* RelationalOperator: '<S75>/Relational Operator' incorporates: |
| 7683 | * Constant: '<S75>/Constant' |
| 7684 | */ |
| 7685 | L4_MABX_B.APTC_arb_pedal_low_idl_sw_o = (APTC_PEDAL_LOW_IDLE_SW_THR_APV > |
| 7686 | L4_MABX_B.If_Then_Else_f.Switch); |
| 7687 | |
| 7688 | /* DataTypeConversion: '<S84>/Data Type Conversion1' */ |
| 7689 | L4_MABX_B.DataTypeConversion1_av = L4_MABX_B.SPN544_EngineReferenceTorque; |
| 7690 | |
| 7691 | /* RelationalOperator: '<S89>/Relational Operator1' incorporates: |
| 7692 | * Constant: '<S84>/EngRefTqLimHigh' |
| 7693 | */ |
| 7694 | L4_MABX_B.RelationalOperator1_i = (L4_MABX_B.DataTypeConversion1_av >= |
| 7695 | L4_MABX_P.EngRefTqLimHigh_Value); |
| 7696 | |
| 7697 | /* RelationalOperator: '<S89>/Relational Operator' incorporates: |
| 7698 | * Constant: '<S84>/EngRefTqLimLow' |
| 7699 | */ |
| 7700 | L4_MABX_B.RelationalOperator_ca = (L4_MABX_B.DataTypeConversion1_av <= |
| 7701 | L4_MABX_P.EngRefTqLimLow_Value); |
| 7702 | |
| 7703 | /* Outputs for Atomic SubSystem: '<S89>/If_Then_Else1' */ |
| 7704 | |
| 7705 | /* Constant: '<S84>/EngRefTqLimLow' */ |
| 7706 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_ca, |
| 7707 | L4_MABX_P.EngRefTqLimLow_Value, |
| 7708 | L4_MABX_B.DataTypeConversion1_av, |
| 7709 | &L4_MABX_B.If_Then_Else1_lo); |
| 7710 | |
| 7711 | /* End of Outputs for SubSystem: '<S89>/If_Then_Else1' */ |
| 7712 | |
| 7713 | /* Outputs for Atomic SubSystem: '<S89>/If_Then_Else' */ |
| 7714 | |
| 7715 | /* Constant: '<S84>/EngRefTqLimHigh' */ |
| 7716 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_i, |
| 7717 | L4_MABX_P.EngRefTqLimHigh_Value, |
| 7718 | L4_MABX_B.If_Then_Else1_lo.Switch, |
| 7719 | &L4_MABX_B.If_Then_Else_ff); |
| 7720 | |
| 7721 | /* End of Outputs for SubSystem: '<S89>/If_Then_Else' */ |
| 7722 | |
| 7723 | /* Sum: '<S84>/Subtract' incorporates: |
| 7724 | * Constant: '<S84>/FrictionTrqAtRefTrqSpeed' |
| 7725 | */ |
| 7726 | L4_MABX_B.Subtract_j = L4_MABX_B.If_Then_Else_ff.Switch - |
| 7727 | L4_MABX_P.FrictionTrqAtRefTrqSpeed_Value; |
| 7728 | |
| 7729 | /* Product: '<S84>/Divide' incorporates: |
| 7730 | * Constant: '<S84>/Constant1' |
| 7731 | */ |
| 7732 | L4_MABX_B.Divide_h = L4_MABX_B.If_Then_Else1_l.Switch * |
| 7733 | L4_MABX_P.Constant1_Value_fg / L4_MABX_B.Subtract_j; |
| 7734 | |
| 7735 | /* RelationalOperator: '<S90>/Relational Operator1' incorporates: |
| 7736 | * Constant: '<S84>/APPTqPercentMax' |
| 7737 | */ |
| 7738 | L4_MABX_B.RelationalOperator1_a = (L4_MABX_B.Divide_h >= |
| 7739 | L4_MABX_P.APPTqPercentMax_Value); |
| 7740 | |
| 7741 | /* RelationalOperator: '<S90>/Relational Operator' incorporates: |
| 7742 | * Constant: '<S84>/APPTqPercentMin' |
| 7743 | */ |
| 7744 | L4_MABX_B.RelationalOperator_n = (L4_MABX_B.Divide_h <= |
| 7745 | L4_MABX_P.APPTqPercentMin_Value); |
| 7746 | |
| 7747 | /* Outputs for Atomic SubSystem: '<S90>/If_Then_Else1' */ |
| 7748 | |
| 7749 | /* Constant: '<S84>/APPTqPercentMin' */ |
| 7750 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_n, |
| 7751 | L4_MABX_P.APPTqPercentMin_Value, L4_MABX_B.Divide_h, |
| 7752 | &L4_MABX_B.If_Then_Else1_p); |
| 7753 | |
| 7754 | /* End of Outputs for SubSystem: '<S90>/If_Then_Else1' */ |
| 7755 | |
| 7756 | /* Outputs for Atomic SubSystem: '<S90>/If_Then_Else' */ |
| 7757 | |
| 7758 | /* Constant: '<S84>/APPTqPercentMax' */ |
| 7759 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_a, |
| 7760 | L4_MABX_P.APPTqPercentMax_Value, |
| 7761 | L4_MABX_B.If_Then_Else1_p.Switch, |
| 7762 | &L4_MABX_B.If_Then_Else_i); |
| 7763 | |
| 7764 | /* End of Outputs for SubSystem: '<S90>/If_Then_Else' */ |
| 7765 | |
| 7766 | /* MultiPortSwitch: '<S76>/Autonomous Mode Switch' incorporates: |
| 7767 | * Constant: '<S76>/AUTONOMOUS_MODE_SELECTOR_APV' |
| 7768 | * Constant: '<S76>/GhostMode' |
| 7769 | */ |
| 7770 | if (AUTONOMOUS_MODE_SELECTOR_APV == ENUM_AUTONOMOUS_MODE_T_AUTO) { |
| 7771 | AutonomousOutputEnabled = AutonomousEnabled; |
| 7772 | } else { |
| 7773 | AutonomousOutputEnabled = (L4_MABX_P.GhostMode_Value != 0); |
| 7774 | } |
| 7775 | |
| 7776 | /* End of MultiPortSwitch: '<S76>/Autonomous Mode Switch' */ |
| 7777 | |
| 7778 | /* Switch: '<S76>/Switch' incorporates: |
| 7779 | * Constant: '<S76>/Failure' |
| 7780 | * Constant: '<S76>/Running' |
| 7781 | */ |
| 7782 | if (EStop) { |
| 7783 | tmp_1 = L4_MABX_P.Running_Value; |
| 7784 | if (tmp_1 < 0) { |
| 7785 | tmp_1 = 0; |
| 7786 | } |
| 7787 | |
| 7788 | MABX_Mode = (uint8_T)tmp_1; |
| 7789 | } else { |
| 7790 | tmp_1 = L4_MABX_P.Failure_Value; |
| 7791 | if (tmp_1 < 0) { |
| 7792 | tmp_1 = 0; |
| 7793 | } |
| 7794 | |
| 7795 | MABX_Mode = (uint8_T)tmp_1; |
| 7796 | } |
| 7797 | |
| 7798 | /* End of Switch: '<S76>/Switch' */ |
| 7799 | |
| 7800 | /* DataTypeConversion: '<S104>/Data Type Conversion2' */ |
| 7801 | PositionFinalLimited = floor(L4_MABX_B.SFunction1_o8_fx); |
| 7802 | if (rtIsNaN(PositionFinalLimited) || rtIsInf(PositionFinalLimited)) { |
| 7803 | PositionFinalLimited = 0.0; |
| 7804 | } else { |
| 7805 | PositionFinalLimited = fmod(PositionFinalLimited, 256.0); |
| 7806 | } |
| 7807 | |
| 7808 | L4_MABX_B.DataTypeConversion2_ew = (uint8_T)(PositionFinalLimited < 0.0 ? |
| 7809 | (int32_T)(uint8_T)-(int8_T)(uint8_T)-PositionFinalLimited : (int32_T) |
| 7810 | (uint8_T)PositionFinalLimited); |
| 7811 | |
| 7812 | /* End of DataTypeConversion: '<S104>/Data Type Conversion2' */ |
| 7813 | |
| 7814 | /* DataTypeConversion: '<S104>/Data Type Conversion' */ |
| 7815 | L4_MABX_B.DataTypeConversion_lr = (ENUM_SWITCH_T) |
| 7816 | L4_MABX_B.DataTypeConversion2_ew; |
| 7817 | |
| 7818 | /* DataTypeConversion: '<S104>/Data Type Conversion3' */ |
| 7819 | PositionFinalLimited = floor(L4_MABX_B.SFunction1_o4_mt); |
| 7820 | if (rtIsNaN(PositionFinalLimited) || rtIsInf(PositionFinalLimited)) { |
| 7821 | PositionFinalLimited = 0.0; |
| 7822 | } else { |
| 7823 | PositionFinalLimited = fmod(PositionFinalLimited, 256.0); |
| 7824 | } |
| 7825 | |
| 7826 | L4_MABX_B.DataTypeConversion3_ps = (uint8_T)(PositionFinalLimited < 0.0 ? |
| 7827 | (int32_T)(uint8_T)-(int8_T)(uint8_T)-PositionFinalLimited : (int32_T) |
| 7828 | (uint8_T)PositionFinalLimited); |
| 7829 | |
| 7830 | /* End of DataTypeConversion: '<S104>/Data Type Conversion3' */ |
| 7831 | |
| 7832 | /* DataTypeConversion: '<S104>/Data Type Conversion1' */ |
| 7833 | L4_MABX_B.DataTypeConversion1_lu = (ENUM_SWITCH_T) |
| 7834 | L4_MABX_B.DataTypeConversion3_ps; |
| 7835 | |
| 7836 | /* RelationalOperator: '<S104>/Relational Operator3' incorporates: |
| 7837 | * Constant: '<S104>/CPV3' |
| 7838 | */ |
| 7839 | L4_MABX_B.RelationalOperator3_c[0] = (L4_MABX_B.DataTypeConversion_lr == |
| 7840 | L4_MABX_P.CPV3_Value_p); |
| 7841 | L4_MABX_B.RelationalOperator3_c[1] = (L4_MABX_B.DataTypeConversion1_lu == |
| 7842 | L4_MABX_P.CPV3_Value_p); |
| 7843 | |
| 7844 | /* Logic: '<S104>/Logical Operator4' */ |
| 7845 | L4_MABX_B.LogicalOperator4_o = (L4_MABX_B.RelationalOperator3_c[0] && |
| 7846 | L4_MABX_B.RelationalOperator3_c[1]); |
| 7847 | |
| 7848 | /* Gain: '<S104>/Gain4' */ |
| 7849 | L4_MABX_B.Primary_brake_circuit_pressure_ = L4_MABX_P.Gain4_Gain * |
| 7850 | L4_MABX_B.PressureP42; |
| 7851 | |
| 7852 | /* Gain: '<S104>/Gain5' */ |
| 7853 | L4_MABX_B.Secondary_brake_circuit_pressur = L4_MABX_P.Gain5_Gain * |
| 7854 | L4_MABX_B.PressureP4; |
| 7855 | |
| 7856 | /* RelationalOperator: '<S104>/Relational Operator4' incorporates: |
| 7857 | * Constant: '<S104>/BRAKE_APPL_THRESHOLD_KPA_APV' |
| 7858 | */ |
| 7859 | L4_MABX_B.RelationalOperator4[0] = (L4_MABX_B.Primary_brake_circuit_pressure_ > |
| 7860 | L4_MABX_P.BRAKE_APPL_THRESHOLD_KPA_APV_Va); |
| 7861 | L4_MABX_B.RelationalOperator4[1] = (L4_MABX_B.Secondary_brake_circuit_pressur > |
| 7862 | L4_MABX_P.BRAKE_APPL_THRESHOLD_KPA_APV_Va); |
| 7863 | |
| 7864 | /* Logic: '<S104>/Logical Operator3' */ |
| 7865 | L4_MABX_B.F_Service_brake_pressure_applie = (L4_MABX_B.RelationalOperator4[0] || |
| 7866 | L4_MABX_B.RelationalOperator4[1]); |
| 7867 | |
| 7868 | /* RelationalOperator: '<S104>/Relational Operator6' incorporates: |
| 7869 | * Constant: '<S104>/CPV4' |
| 7870 | */ |
| 7871 | L4_MABX_B.RelationalOperator6[0] = (L4_MABX_B.DataTypeConversion_lr == |
| 7872 | L4_MABX_P.CPV4_Value_n); |
| 7873 | L4_MABX_B.RelationalOperator6[1] = (L4_MABX_B.DataTypeConversion1_lu == |
| 7874 | L4_MABX_P.CPV4_Value_n); |
| 7875 | |
| 7876 | /* Logic: '<S104>/Logical Operator' */ |
| 7877 | L4_MABX_B.F_Brake_sw_CAN = (L4_MABX_B.RelationalOperator6[0] || |
| 7878 | L4_MABX_B.RelationalOperator6[1]); |
| 7879 | |
| 7880 | /* Logic: '<S104>/Logical Operator5' */ |
| 7881 | L4_MABX_B.LogicalOperator5_n = (L4_MABX_B.F_Service_brake_pressure_applie || |
| 7882 | L4_MABX_B.F_Brake_sw_CAN); |
| 7883 | |
| 7884 | /* Outputs for Atomic SubSystem: '<S104>/If_Then_Else' */ |
| 7885 | L4_MABX_If_Then_Else_l(L4_MABX_B.LogicalOperator4_o, |
| 7886 | L4_MABX_B.F_Service_brake_pressure_applie, L4_MABX_B.LogicalOperator5_n, |
| 7887 | &L4_MABX_B.If_Then_Else_l); |
| 7888 | |
| 7889 | /* End of Outputs for SubSystem: '<S104>/If_Then_Else' */ |
| 7890 | |
| 7891 | /* RelationalOperator: '<S108>/Relational Operator1' incorporates: |
| 7892 | * Constant: '<S108>/SPN904_ZERO_SPD_CPV' |
| 7893 | */ |
| 7894 | L4_MABX_B.F_Vehicle_stopped = (L4_MABX_B.DataTypeConversion5_oo <= |
| 7895 | L4_MABX_P.SPN904_ZERO_SPD_CPV_Value); |
| 7896 | |
| 7897 | /* Sum: '<S105>/Add' */ |
| 7898 | L4_MABX_B.Add_d = L4_MABX_B.Primary_brake_circuit_pressure_ + |
| 7899 | L4_MABX_B.Secondary_brake_circuit_pressur; |
| 7900 | |
| 7901 | /* Gain: '<S105>/Gain' */ |
| 7902 | L4_MABX_B.Gain_go = L4_MABX_P.Gain_Gain_g * L4_MABX_B.Add_d; |
| 7903 | |
| 7904 | /* Outputs for Enabled SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' incorporates: |
| 7905 | * EnablePort: '<S184>/Enable' |
| 7906 | */ |
| 7907 | if (L4_MABX_DW.Determine_shift_interlock_brake) { |
| 7908 | /* Disable for Outport: '<S184>/Shift_interlock_brake_press_target_kpa' */ |
| 7909 | L4_MABX_B.If_Then_Else_il.Switch = L4_MABX_P.Shift_interlock_brake_press_tar; |
| 7910 | |
| 7911 | /* Disable for Outport: '<S184>/F_Shift_interlock_conditions_met' */ |
| 7912 | L4_MABX_B.F_Shift_interlock_conditions_me = |
| 7913 | L4_MABX_P.F_Shift_interlock_conditions_me; |
| 7914 | L4_MABX_DW.Determine_shift_interlock_brake = false; |
| 7915 | } |
| 7916 | |
| 7917 | /* End of Outputs for SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */ |
| 7918 | |
| 7919 | /* RelationalOperator: '<S206>/Compare' incorporates: |
| 7920 | * Constant: '<S206>/Constant' |
| 7921 | */ |
| 7922 | L4_MABX_B.Compare_g4 = (L4_MABX_B.VSPD_TARGET_KPH_APV_g == |
| 7923 | L4_MABX_P.Constant_Value_ol); |
| 7924 | |
| 7925 | /* RelationalOperator: '<S109>/Relational Operator4' */ |
| 7926 | L4_MABX_B.RelationalOperator4_l = (L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b >= |
| 7927 | L4_MABX_B.DataTypeConversion5_oo); |
| 7928 | |
| 7929 | /* Logic: '<S109>/Logical Operator3' */ |
| 7930 | L4_MABX_B.F_Hold_brakes_at_zero_d = (L4_MABX_B.F_Brake_control_active && |
| 7931 | L4_MABX_B.Compare_g4 && L4_MABX_B.RelationalOperator4_l); |
| 7932 | |
| 7933 | /* Outputs for Enabled SubSystem: '<S105>/Determine_brake_hold_pressure_target' incorporates: |
| 7934 | * EnablePort: '<S183>/Enable' |
| 7935 | */ |
| 7936 | if (L4_MABX_B.F_Hold_brakes_at_zero_d) { |
| 7937 | if (!L4_MABX_DW.Determine_brake_hold_pressure_t) { |
| 7938 | /* InitializeConditions for UnitDelay: '<S183>/Unit_Delay' */ |
| 7939 | L4_MABX_DW.Unit_Delay_DSTATE_c = L4_MABX_P.Unit_Delay_InitialCondition_d; |
| 7940 | |
| 7941 | /* InitializeConditions for UnitDelay: '<S187>/Unit_Delay' */ |
| 7942 | L4_MABX_DW.Unit_Delay_DSTATE_or = L4_MABX_P.Unit_Delay_InitialCondition_fy; |
| 7943 | |
| 7944 | /* InitializeConditions for UnitDelay: '<S191>/FixPt Unit Delay2' */ |
| 7945 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_je = |
| 7946 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_e; |
| 7947 | |
| 7948 | /* InitializeConditions for UnitDelay: '<S191>/FixPt Unit Delay1' */ |
| 7949 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_b = |
| 7950 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_p; |
| 7951 | |
| 7952 | /* InitializeConditions for UnitDelay: '<S188>/Unit_Delay' */ |
| 7953 | L4_MABX_DW.Unit_Delay_DSTATE_oj = L4_MABX_P.Unit_Delay_InitialCondition_k; |
| 7954 | L4_MABX_DW.Determine_brake_hold_pressure_t = true; |
| 7955 | } |
| 7956 | |
| 7957 | /* Logic: '<S183>/Logical Operator2' */ |
| 7958 | L4_MABX_B.F_Brake_hold_conditions_met = (L4_MABX_B.If_Then_Else_l.Switch && |
| 7959 | L4_MABX_B.F_Vehicle_stopped); |
| 7960 | |
| 7961 | /* UnitDelay: '<S183>/Unit_Delay' */ |
| 7962 | L4_MABX_B.Unit_Delay_a = L4_MABX_DW.Unit_Delay_DSTATE_c; |
| 7963 | |
| 7964 | /* UnitDelay: '<S187>/Unit_Delay' */ |
| 7965 | L4_MABX_B.Unit_Delay_h0 = L4_MABX_DW.Unit_Delay_DSTATE_or; |
| 7966 | |
| 7967 | /* Logic: '<S187>/Logical Operator1' incorporates: |
| 7968 | * Constant: '<S183>/CPV1' |
| 7969 | */ |
| 7970 | L4_MABX_B.LogicalOperator1_ou = (L4_MABX_P.CPV1_Value_p || |
| 7971 | L4_MABX_B.Unit_Delay_h0); |
| 7972 | |
| 7973 | /* Outputs for Atomic SubSystem: '<S183>/If_Then_Else1' */ |
| 7974 | |
| 7975 | /* Constant: '<S183>/CPV' */ |
| 7976 | L4_MABX_If_Then_Else_g(L4_MABX_B.F_Brake_hold_conditions_met, |
| 7977 | L4_MABX_B.Unit_Delay_a, L4_MABX_P.CPV_Value_k, &L4_MABX_B.If_Then_Else1_mf); |
| 7978 | |
| 7979 | /* End of Outputs for SubSystem: '<S183>/If_Then_Else1' */ |
| 7980 | |
| 7981 | /* UnitDelay: '<S191>/FixPt Unit Delay2' */ |
| 7982 | L4_MABX_B.FixPtUnitDelay2_do = L4_MABX_DW.FixPtUnitDelay2_DSTATE_je; |
| 7983 | |
| 7984 | /* UnitDelay: '<S191>/FixPt Unit Delay1' */ |
| 7985 | L4_MABX_B.Xold_bf = L4_MABX_DW.FixPtUnitDelay1_DSTATE_b; |
| 7986 | |
| 7987 | /* Switch: '<S191>/Init' */ |
| 7988 | if (L4_MABX_B.FixPtUnitDelay2_do != 0) { |
| 7989 | L4_MABX_B.Init_k = L4_MABX_B.If_Then_Else1_mf.Switch; |
| 7990 | } else { |
| 7991 | L4_MABX_B.Init_k = L4_MABX_B.Xold_bf; |
| 7992 | } |
| 7993 | |
| 7994 | /* End of Switch: '<S191>/Init' */ |
| 7995 | |
| 7996 | /* Abs: '<S187>/Abs' incorporates: |
| 7997 | * Constant: '<S183>/BRAKE_PRESS_TARGET_S LEW_INC_APV' |
| 7998 | */ |
| 7999 | L4_MABX_B.Abs_bu = fabs(L4_MABX_P.BRAKE_PRESS_TARGET_SLEW_INC_APV); |
| 8000 | |
| 8001 | /* DigitalClock: '<S188>/Digital Clock' */ |
| 8002 | L4_MABX_B.DigitalClock_c = L4_MABX_M->Timing.t[0]; |
| 8003 | |
| 8004 | /* UnitDelay: '<S188>/Unit_Delay' */ |
| 8005 | L4_MABX_B.Unit_Delay_ka = L4_MABX_DW.Unit_Delay_DSTATE_oj; |
| 8006 | |
| 8007 | /* Sum: '<S188>/Subtract' */ |
| 8008 | L4_MABX_B.Subtract_ko = L4_MABX_B.DigitalClock_c - L4_MABX_B.Unit_Delay_ka; |
| 8009 | |
| 8010 | /* Product: '<S187>/Product1' */ |
| 8011 | L4_MABX_B.Product1_f = L4_MABX_B.Abs_bu * L4_MABX_B.Subtract_ko; |
| 8012 | |
| 8013 | /* Sum: '<S187>/Add1' */ |
| 8014 | L4_MABX_B.Add1_cj = L4_MABX_B.Init_k + L4_MABX_B.Product1_f; |
| 8015 | |
| 8016 | /* MinMax: '<S187>/MinMax2' */ |
| 8017 | DeltaTime = L4_MABX_B.If_Then_Else1_mf.Switch; |
| 8018 | PositionFinalLimited = L4_MABX_B.Add1_cj; |
| 8019 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8020 | PositionFinalLimited = DeltaTime; |
| 8021 | } |
| 8022 | |
| 8023 | L4_MABX_B.MinMax2_c2 = PositionFinalLimited; |
| 8024 | |
| 8025 | /* End of MinMax: '<S187>/MinMax2' */ |
| 8026 | |
| 8027 | /* Abs: '<S187>/Abs1' incorporates: |
| 8028 | * Constant: '<S183>/BRAKE_PRESS_TARGET_SLEW_DEC_APV' |
| 8029 | */ |
| 8030 | L4_MABX_B.Abs1_ar = fabs(L4_MABX_P.BRAKE_PRESS_TARGET_SLEW_DEC_APV); |
| 8031 | |
| 8032 | /* Product: '<S187>/Product2' */ |
| 8033 | L4_MABX_B.Product2_c3 = L4_MABX_B.Subtract_ko * L4_MABX_B.Abs1_ar; |
| 8034 | |
| 8035 | /* Sum: '<S187>/Subtract1' */ |
| 8036 | L4_MABX_B.Subtract1_ev = L4_MABX_B.Init_k - L4_MABX_B.Product2_c3; |
| 8037 | |
| 8038 | /* MinMax: '<S187>/MinMax1' */ |
| 8039 | DeltaTime = L4_MABX_B.MinMax2_c2; |
| 8040 | PositionFinalLimited = L4_MABX_B.Subtract1_ev; |
| 8041 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8042 | PositionFinalLimited = DeltaTime; |
| 8043 | } |
| 8044 | |
| 8045 | L4_MABX_B.MinMax1_jw = PositionFinalLimited; |
| 8046 | |
| 8047 | /* End of MinMax: '<S187>/MinMax1' */ |
| 8048 | |
| 8049 | /* Outputs for Atomic SubSystem: '<S187>/If_Then_Else' */ |
| 8050 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_ou, L4_MABX_B.Gain_go, |
| 8051 | L4_MABX_B.MinMax1_jw, &L4_MABX_B.If_Then_Else_nz); |
| 8052 | |
| 8053 | /* End of Outputs for SubSystem: '<S187>/If_Then_Else' */ |
| 8054 | |
| 8055 | /* Outputs for Atomic SubSystem: '<S183>/If_Then_Else' */ |
| 8056 | L4_MABX_If_Then_Else_g(L4_MABX_B.F_Brake_hold_conditions_met, |
| 8057 | L4_MABX_B.Unit_Delay_a, L4_MABX_B.If_Then_Else_nz.Switch, |
| 8058 | &L4_MABX_B.If_Then_Else_gj); |
| 8059 | |
| 8060 | /* End of Outputs for SubSystem: '<S183>/If_Then_Else' */ |
| 8061 | |
| 8062 | /* RelationalOperator: '<S189>/min_relop' incorporates: |
| 8063 | * Constant: '<S183>/BRAKE_PRESS_TARGET_S LEW_INC_APV' |
| 8064 | * Constant: '<S189>/min_val' |
| 8065 | */ |
| 8066 | L4_MABX_B.min_relop_i = (L4_MABX_P.CheckStaticLowerBound_min_i <= |
| 8067 | L4_MABX_P.BRAKE_PRESS_TARGET_SLEW_INC_APV); |
| 8068 | |
| 8069 | /* Assertion: '<S189>/Assertion' */ |
| 8070 | utAssert(L4_MABX_B.min_relop_i); |
| 8071 | } else { |
| 8072 | if (L4_MABX_DW.Determine_brake_hold_pressure_t) { |
| 8073 | /* Disable for Outport: '<S183>/Brake_hold_brake_press_target_kpa' */ |
| 8074 | L4_MABX_B.If_Then_Else_gj.Switch = |
| 8075 | L4_MABX_P.Brake_hold_brake_press_target_k; |
| 8076 | |
| 8077 | /* Disable for Outport: '<S183>/F_Brake_hold_conditions_met' */ |
| 8078 | L4_MABX_B.F_Brake_hold_conditions_met = |
| 8079 | L4_MABX_P.F_Brake_hold_conditions_met_Y0; |
| 8080 | L4_MABX_DW.Determine_brake_hold_pressure_t = false; |
| 8081 | } |
| 8082 | } |
| 8083 | |
| 8084 | /* End of Outputs for SubSystem: '<S105>/Determine_brake_hold_pressure_target' */ |
| 8085 | |
| 8086 | /* MinMax: '<S105>/MinMax' */ |
| 8087 | DeltaTime = L4_MABX_B.If_Then_Else_il.Switch; |
| 8088 | PositionFinalLimited = L4_MABX_B.If_Then_Else_gj.Switch; |
| 8089 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8090 | PositionFinalLimited = DeltaTime; |
| 8091 | } |
| 8092 | |
| 8093 | L4_MABX_B.Brake_pressure_target_kpa = PositionFinalLimited; |
| 8094 | |
| 8095 | /* End of MinMax: '<S105>/MinMax' */ |
| 8096 | |
| 8097 | /* Gain: '<S104>/Gain1' */ |
| 8098 | L4_MABX_B.Bendix_2C2_Primary_brake_circui = L4_MABX_P.Gain1_Gain * |
| 8099 | L4_MABX_B.PressureP21; |
| 8100 | |
| 8101 | /* Gain: '<S104>/Gain2' */ |
| 8102 | L4_MABX_B.Bendix_2C2_Secondary_brake_circ = L4_MABX_P.Gain2_Gain * |
| 8103 | L4_MABX_B.PressureP22; |
| 8104 | |
| 8105 | /* Sum: '<S106>/Add' */ |
| 8106 | L4_MABX_B.Add_n = L4_MABX_B.Primary_brake_circuit_pressure_ + |
| 8107 | L4_MABX_B.Secondary_brake_circuit_pressur; |
| 8108 | |
| 8109 | /* Gain: '<S106>/Gain' */ |
| 8110 | L4_MABX_B.brake_system_avg_appl_pressure_ = L4_MABX_P.Gain_Gain_i * |
| 8111 | L4_MABX_B.Add_n; |
| 8112 | |
| 8113 | /* Gain: '<S104>/Gain3' */ |
| 8114 | L4_MABX_B.Primary_brake_circuit_pressur_n = L4_MABX_P.Gain3_Gain * |
| 8115 | L4_MABX_B.PressureP1; |
| 8116 | |
| 8117 | /* Product: '<S106>/Divide2' */ |
| 8118 | L4_MABX_B.Divide2 = L4_MABX_B.brake_system_avg_appl_pressure_ / |
| 8119 | L4_MABX_B.Primary_brake_circuit_pressur_n; |
| 8120 | |
| 8121 | /* Gain: '<S106>/Gain5' */ |
| 8122 | L4_MABX_B.Gain5 = L4_MABX_P.Gain5_Gain_l * L4_MABX_B.Divide2; |
| 8123 | |
| 8124 | /* Saturate: '<S106>/Saturation3' */ |
| 8125 | DeltaTime = L4_MABX_B.Gain5; |
| 8126 | Time56 = L4_MABX_P.Saturation3_LowerSat; |
| 8127 | PositionFinalLimited = L4_MABX_P.Saturation3_UpperSat; |
| 8128 | if (DeltaTime > PositionFinalLimited) { |
| 8129 | L4_MABX_B.Brake_appl_percent = PositionFinalLimited; |
| 8130 | } else if (DeltaTime < Time56) { |
| 8131 | L4_MABX_B.Brake_appl_percent = Time56; |
| 8132 | } else { |
| 8133 | L4_MABX_B.Brake_appl_percent = DeltaTime; |
| 8134 | } |
| 8135 | |
| 8136 | /* End of Saturate: '<S106>/Saturation3' */ |
| 8137 | |
| 8138 | /* Outputs for Enabled SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' incorporates: |
| 8139 | * EnablePort: '<S102>/Enable' |
| 8140 | */ |
| 8141 | if (L4_MABX_B.F_Hold_brakes_at_zero_d) { |
| 8142 | if (!L4_MABX_DW.Bendix_2C2_brake_application_pr) { |
| 8143 | /* InitializeConditions for UnitDelay: '<S111>/Unit_Delay' */ |
| 8144 | L4_MABX_DW.Unit_Delay_DSTATE_d = L4_MABX_P.Unit_Delay_InitialCondition; |
| 8145 | |
| 8146 | /* InitializeConditions for UnitDelay: '<S115>/Unit_Delay' */ |
| 8147 | L4_MABX_DW.Unit_Delay_DSTATE_omj = |
| 8148 | L4_MABX_P.Unit_Delay_InitialCondition_lt; |
| 8149 | |
| 8150 | /* InitializeConditions for UnitDelay: '<S135>/Unit_Delay1' */ |
| 8151 | L4_MABX_DW.Unit_Delay1_DSTATE_b = L4_MABX_P.Unit_Delay1_InitialCondition; |
| 8152 | |
| 8153 | /* InitializeConditions for UnitDelay: '<S136>/Unit_Delay' */ |
| 8154 | L4_MABX_DW.Unit_Delay_DSTATE_h4 = L4_MABX_P.Unit_Delay_InitialCondition_og; |
| 8155 | |
| 8156 | /* InitializeConditions for UnitDelay: '<S140>/FixPt Unit Delay2' */ |
| 8157 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_gm = |
| 8158 | L4_MABX_P.FixPtUnitDelay2_InitialConditio; |
| 8159 | |
| 8160 | /* InitializeConditions for UnitDelay: '<S140>/FixPt Unit Delay1' */ |
| 8161 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g1 = |
| 8162 | L4_MABX_P.FixPtUnitDelay1_InitialConditio; |
| 8163 | |
| 8164 | /* InitializeConditions for UnitDelay: '<S135>/Unit_Delay2' */ |
| 8165 | L4_MABX_DW.Unit_Delay2_DSTATE_dy = L4_MABX_P.Unit_Delay2_InitialCondition; |
| 8166 | |
| 8167 | /* InitializeConditions for UnitDelay: '<S110>/Unit_Delay' */ |
| 8168 | L4_MABX_DW.Unit_Delay_DSTATE_i = L4_MABX_P.Unit_Delay_InitialCondition_p; |
| 8169 | L4_MABX_DW.Bendix_2C2_brake_application_pr = true; |
| 8170 | } |
| 8171 | |
| 8172 | /* Sum: '<S102>/Add' */ |
| 8173 | L4_MABX_B.Add_my = L4_MABX_B.Bendix_2C2_Primary_brake_circui + |
| 8174 | L4_MABX_B.Bendix_2C2_Secondary_brake_circ; |
| 8175 | |
| 8176 | /* Gain: '<S102>/Gain' */ |
| 8177 | L4_MABX_B.Gain_iv = L4_MABX_P.Gain_Gain * L4_MABX_B.Add_my; |
| 8178 | |
| 8179 | /* Abs: '<S112>/Abs' incorporates: |
| 8180 | * Constant: '<S102>/BRK_PRESS_DEM_KI_APV' |
| 8181 | */ |
| 8182 | L4_MABX_B.Abs_k4 = fabs(L4_MABX_P.BRK_PRESS_DEM_KI_APV_Value); |
| 8183 | |
| 8184 | /* Abs: '<S112>/Abs1' incorporates: |
| 8185 | * Constant: '<S102>/BRK_PRESS_DEM_KD_APV' |
| 8186 | */ |
| 8187 | L4_MABX_B.Abs1_ap = fabs(L4_MABX_P.BRK_PRESS_DEM_KD_APV_Value); |
| 8188 | |
| 8189 | /* DigitalClock: '<S111>/Digital Clock' */ |
| 8190 | L4_MABX_B.DigitalClock_j = L4_MABX_M->Timing.t[0]; |
| 8191 | |
| 8192 | /* UnitDelay: '<S111>/Unit_Delay' */ |
| 8193 | L4_MABX_B.Unit_Delay_j = L4_MABX_DW.Unit_Delay_DSTATE_d; |
| 8194 | |
| 8195 | /* Sum: '<S111>/Subtract' */ |
| 8196 | L4_MABX_B.Subtract_jr = L4_MABX_B.DigitalClock_j - L4_MABX_B.Unit_Delay_j; |
| 8197 | |
| 8198 | /* UnitDelay: '<S115>/Unit_Delay' */ |
| 8199 | L4_MABX_B.Unit_Delay_nm = L4_MABX_DW.Unit_Delay_DSTATE_omj; |
| 8200 | |
| 8201 | /* Logic: '<S115>/Logical Operator1' incorporates: |
| 8202 | * Constant: '<S102>/CPV2' |
| 8203 | */ |
| 8204 | L4_MABX_B.LogicalOperator1_ax = (L4_MABX_B.Unit_Delay_nm || |
| 8205 | L4_MABX_P.CPV2_Value_m); |
| 8206 | |
| 8207 | /* UnitDelay: '<S135>/Unit_Delay1' */ |
| 8208 | L4_MABX_B.Unit_Delay1_i = L4_MABX_DW.Unit_Delay1_DSTATE_b; |
| 8209 | |
| 8210 | /* Logic: '<S135>/Logical Operator' */ |
| 8211 | L4_MABX_B.LogicalOperator_mu = (L4_MABX_B.LogicalOperator1_ax || |
| 8212 | L4_MABX_B.Unit_Delay1_i); |
| 8213 | |
| 8214 | /* UnitDelay: '<S136>/Unit_Delay' */ |
| 8215 | L4_MABX_B.Unit_Delay_nl = L4_MABX_DW.Unit_Delay_DSTATE_h4; |
| 8216 | |
| 8217 | /* Logic: '<S136>/Logical Operator1' */ |
| 8218 | L4_MABX_B.LogicalOperator1_mk = (L4_MABX_B.LogicalOperator1_ax || |
| 8219 | L4_MABX_B.Unit_Delay_nl); |
| 8220 | |
| 8221 | /* UnitDelay: '<S140>/FixPt Unit Delay2' */ |
| 8222 | L4_MABX_B.FixPtUnitDelay2_op = L4_MABX_DW.FixPtUnitDelay2_DSTATE_gm; |
| 8223 | |
| 8224 | /* UnitDelay: '<S140>/FixPt Unit Delay1' */ |
| 8225 | L4_MABX_B.Xold_g3 = L4_MABX_DW.FixPtUnitDelay1_DSTATE_g1; |
| 8226 | |
| 8227 | /* Switch: '<S140>/Init' */ |
| 8228 | if (L4_MABX_B.FixPtUnitDelay2_op != 0) { |
| 8229 | L4_MABX_B.Init_hw = L4_MABX_B.Brake_pressure_target_kpa; |
| 8230 | } else { |
| 8231 | L4_MABX_B.Init_hw = L4_MABX_B.Xold_g3; |
| 8232 | } |
| 8233 | |
| 8234 | /* End of Switch: '<S140>/Init' */ |
| 8235 | |
| 8236 | /* Abs: '<S136>/Abs' incorporates: |
| 8237 | * Constant: '<S102>/CPV4' |
| 8238 | */ |
| 8239 | L4_MABX_B.Abs_l = fabs(L4_MABX_P.CPV4_Value); |
| 8240 | |
| 8241 | /* Product: '<S136>/Product1' */ |
| 8242 | L4_MABX_B.Product1_b = L4_MABX_B.Abs_l * L4_MABX_B.Subtract_jr; |
| 8243 | |
| 8244 | /* Sum: '<S136>/Add1' */ |
| 8245 | L4_MABX_B.Add1_hu = L4_MABX_B.Init_hw + L4_MABX_B.Product1_b; |
| 8246 | |
| 8247 | /* MinMax: '<S136>/MinMax2' */ |
| 8248 | DeltaTime = L4_MABX_B.Brake_pressure_target_kpa; |
| 8249 | PositionFinalLimited = L4_MABX_B.Add1_hu; |
| 8250 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8251 | PositionFinalLimited = DeltaTime; |
| 8252 | } |
| 8253 | |
| 8254 | L4_MABX_B.MinMax2_b = PositionFinalLimited; |
| 8255 | |
| 8256 | /* End of MinMax: '<S136>/MinMax2' */ |
| 8257 | |
| 8258 | /* Abs: '<S136>/Abs1' incorporates: |
| 8259 | * Constant: '<S102>/CPV5' |
| 8260 | */ |
| 8261 | L4_MABX_B.Abs1_d1 = fabs(L4_MABX_P.CPV5_Value); |
| 8262 | |
| 8263 | /* Product: '<S136>/Product2' */ |
| 8264 | L4_MABX_B.Product2_dl = L4_MABX_B.Subtract_jr * L4_MABX_B.Abs1_d1; |
| 8265 | |
| 8266 | /* Sum: '<S136>/Subtract1' */ |
| 8267 | L4_MABX_B.Subtract1_a = L4_MABX_B.Init_hw - L4_MABX_B.Product2_dl; |
| 8268 | |
| 8269 | /* MinMax: '<S136>/MinMax1' */ |
| 8270 | DeltaTime = L4_MABX_B.MinMax2_b; |
| 8271 | PositionFinalLimited = L4_MABX_B.Subtract1_a; |
| 8272 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8273 | PositionFinalLimited = DeltaTime; |
| 8274 | } |
| 8275 | |
| 8276 | L4_MABX_B.MinMax1_ps = PositionFinalLimited; |
| 8277 | |
| 8278 | /* End of MinMax: '<S136>/MinMax1' */ |
| 8279 | |
| 8280 | /* Outputs for Atomic SubSystem: '<S136>/If_Then_Else' */ |
| 8281 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_mk, L4_MABX_B.Gain_iv, |
| 8282 | L4_MABX_B.MinMax1_ps, &L4_MABX_B.If_Then_Else_bg); |
| 8283 | |
| 8284 | /* End of Outputs for SubSystem: '<S136>/If_Then_Else' */ |
| 8285 | |
| 8286 | /* Sum: '<S113>/Subtract' */ |
| 8287 | L4_MABX_B.Subtract_n = L4_MABX_B.If_Then_Else_bg.Switch - L4_MABX_B.Gain_iv; |
| 8288 | |
| 8289 | /* MinMax: '<S135>/MinMax1' incorporates: |
| 8290 | * Constant: '<S102>/BRK_PRESS_DEM_T_FILT_CTRL_ERROR_APV' |
| 8291 | */ |
| 8292 | DeltaTime = L4_MABX_B.Subtract_jr; |
| 8293 | PositionFinalLimited = L4_MABX_P.BRK_PRESS_DEM_T_FILT_CTRL_ERROR; |
| 8294 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8295 | PositionFinalLimited = DeltaTime; |
| 8296 | } |
| 8297 | |
| 8298 | L4_MABX_B.MinMax1_h1 = PositionFinalLimited; |
| 8299 | |
| 8300 | /* End of MinMax: '<S135>/MinMax1' */ |
| 8301 | |
| 8302 | /* Saturate: '<S135>/Saturation' */ |
| 8303 | DeltaTime = L4_MABX_B.MinMax1_h1; |
| 8304 | Time56 = L4_MABX_P.Saturation_LowerSat; |
| 8305 | PositionFinalLimited = L4_MABX_P.Saturation_UpperSat; |
| 8306 | if (DeltaTime > PositionFinalLimited) { |
| 8307 | L4_MABX_B.Saturation_p = PositionFinalLimited; |
| 8308 | } else if (DeltaTime < Time56) { |
| 8309 | L4_MABX_B.Saturation_p = Time56; |
| 8310 | } else { |
| 8311 | L4_MABX_B.Saturation_p = DeltaTime; |
| 8312 | } |
| 8313 | |
| 8314 | /* End of Saturate: '<S135>/Saturation' */ |
| 8315 | |
| 8316 | /* Product: '<S135>/Divide' */ |
| 8317 | L4_MABX_B.Divide_l = L4_MABX_B.Subtract_jr / L4_MABX_B.Saturation_p; |
| 8318 | |
| 8319 | /* Product: '<S135>/Product2' */ |
| 8320 | L4_MABX_B.Product2_kj = L4_MABX_B.Subtract_n * L4_MABX_B.Divide_l; |
| 8321 | |
| 8322 | /* Sum: '<S135>/Subtract1' incorporates: |
| 8323 | * Constant: '<S135>/Constant1' |
| 8324 | */ |
| 8325 | L4_MABX_B.Subtract1_p = L4_MABX_P.Constant1_Value_f - L4_MABX_B.Divide_l; |
| 8326 | |
| 8327 | /* UnitDelay: '<S135>/Unit_Delay2' */ |
| 8328 | L4_MABX_B.Unit_Delay2_d = L4_MABX_DW.Unit_Delay2_DSTATE_dy; |
| 8329 | |
| 8330 | /* Product: '<S135>/Product1' */ |
| 8331 | L4_MABX_B.Product1_c3 = L4_MABX_B.Subtract1_p * L4_MABX_B.Unit_Delay2_d; |
| 8332 | |
| 8333 | /* Sum: '<S135>/Add1' */ |
| 8334 | L4_MABX_B.Add1_i1 = L4_MABX_B.Product2_kj + L4_MABX_B.Product1_c3; |
| 8335 | |
| 8336 | /* Outputs for Atomic SubSystem: '<S135>/If_Then_Else' */ |
| 8337 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_mu, L4_MABX_B.Subtract_n, |
| 8338 | L4_MABX_B.Add1_i1, &L4_MABX_B.If_Then_Else_ly); |
| 8339 | |
| 8340 | /* End of Outputs for SubSystem: '<S135>/If_Then_Else' */ |
| 8341 | |
| 8342 | /* RelationalOperator: '<S120>/Compare' incorporates: |
| 8343 | * Constant: '<S120>/Constant' |
| 8344 | */ |
| 8345 | L4_MABX_B.Compare_aa = (L4_MABX_B.Abs1_ap > |
| 8346 | L4_MABX_P.CompareToConstant1_const); |
| 8347 | |
| 8348 | /* Outputs for Enabled SubSystem: '<S112>/Calculate_D_term' */ |
| 8349 | |
| 8350 | /* Constant: '<S102>/BRK_PRESS_DEM_KD_APV' incorporates: |
| 8351 | * Constant: '<S102>/BRK_PRESS_DEM_T_FILT_D_APV' |
| 8352 | */ |
| 8353 | L4_MABX_Calculate_D_term(L4_MABX_B.Compare_aa, |
| 8354 | L4_MABX_P.BRK_PRESS_DEM_KD_APV_Value, L4_MABX_B.Subtract_jr, |
| 8355 | L4_MABX_B.LogicalOperator1_ax, L4_MABX_B.If_Then_Else_ly.Switch, |
| 8356 | L4_MABX_P.BRK_PRESS_DEM_T_FILT_D_APV_Valu, &L4_MABX_B.Calculate_D_term, |
| 8357 | &L4_MABX_DW.Calculate_D_term, &L4_MABX_P.Calculate_D_term); |
| 8358 | |
| 8359 | /* End of Outputs for SubSystem: '<S112>/Calculate_D_term' */ |
| 8360 | |
| 8361 | /* Product: '<S118>/Product' incorporates: |
| 8362 | * Constant: '<S102>/BRK_PRESS_DEM_KP_APV' |
| 8363 | */ |
| 8364 | L4_MABX_B.Product_iq = L4_MABX_P.BRK_PRESS_DEM_KP_APV_Value * |
| 8365 | L4_MABX_B.If_Then_Else_ly.Switch; |
| 8366 | |
| 8367 | /* UnitDelay: '<S110>/Unit_Delay' */ |
| 8368 | L4_MABX_B.Unit_Delay_ja = L4_MABX_DW.Unit_Delay_DSTATE_i; |
| 8369 | |
| 8370 | /* RelationalOperator: '<S119>/Compare' incorporates: |
| 8371 | * Constant: '<S119>/Constant' |
| 8372 | */ |
| 8373 | L4_MABX_B.Compare_jrp = (L4_MABX_B.Abs_k4 > |
| 8374 | L4_MABX_P.CompareToConstant_const); |
| 8375 | |
| 8376 | /* Outputs for Enabled SubSystem: '<S112>/Calculate_I_term' */ |
| 8377 | |
| 8378 | /* Constant: '<S102>/BRK_PRESS_DEM_KI_APV' incorporates: |
| 8379 | * Constant: '<S102>/BRK_PRESS_DEM_AW_COND_INT_APV' |
| 8380 | * Constant: '<S102>/BRK_PRESS_DEM_AW_HYSTERESIS_APV' |
| 8381 | * Constant: '<S102>/CPV1' |
| 8382 | * Constant: '<S102>/CPV3' |
| 8383 | */ |
| 8384 | L4_MABX_Calculate_I_term(L4_MABX_B.Compare_jrp, L4_MABX_B.Product_iq, |
| 8385 | L4_MABX_P.BRK_PRESS_DEM_KI_APV_Value, L4_MABX_B.Brake_appl_percent, |
| 8386 | L4_MABX_B.If_Then_Else_ly.Switch, L4_MABX_B.LogicalOperator1_ax, |
| 8387 | L4_MABX_B.Subtract_jr, L4_MABX_P.CPV3_Value, |
| 8388 | L4_MABX_P.BRK_PRESS_DEM_AW_COND_INT_APV_V, |
| 8389 | L4_MABX_P.BRK_PRESS_DEM_AW_HYSTERESIS_APV, L4_MABX_P.CPV1_Value_g, |
| 8390 | L4_MABX_B.Unit_Delay_ja, &L4_MABX_B.Calculate_I_term, |
| 8391 | &L4_MABX_DW.Calculate_I_term, &L4_MABX_P.Calculate_I_term); |
| 8392 | |
| 8393 | /* End of Outputs for SubSystem: '<S112>/Calculate_I_term' */ |
| 8394 | |
| 8395 | /* RelationalOperator: '<S138>/min_relop' incorporates: |
| 8396 | * Constant: '<S102>/CPV4' |
| 8397 | * Constant: '<S138>/min_val' |
| 8398 | */ |
| 8399 | L4_MABX_B.min_relop_ph = (L4_MABX_P.CheckStaticLowerBound_min <= |
| 8400 | L4_MABX_P.CPV4_Value); |
| 8401 | |
| 8402 | /* Assertion: '<S138>/Assertion' */ |
| 8403 | utAssert(L4_MABX_B.min_relop_ph); |
| 8404 | |
| 8405 | /* Sum: '<S114>/Add' incorporates: |
| 8406 | * Constant: '<S102>/CPV3' |
| 8407 | */ |
| 8408 | L4_MABX_B.Add_e = ((L4_MABX_B.Product_iq + |
| 8409 | L4_MABX_B.Calculate_I_term.If_Then_Else.Switch) + |
| 8410 | L4_MABX_B.Calculate_D_term.Subtract) + |
| 8411 | L4_MABX_P.CPV3_Value; |
| 8412 | |
| 8413 | /* RelationalOperator: '<S141>/Relational Operator1' incorporates: |
| 8414 | * Constant: '<S102>/CPV6' |
| 8415 | */ |
| 8416 | L4_MABX_B.RelationalOperator1_gi = (L4_MABX_B.Add_e >= L4_MABX_P.CPV6_Value); |
| 8417 | |
| 8418 | /* RelationalOperator: '<S141>/Relational Operator' incorporates: |
| 8419 | * Constant: '<S102>/CPV' |
| 8420 | */ |
| 8421 | L4_MABX_B.RelationalOperator_b = (L4_MABX_B.Add_e <= L4_MABX_P.CPV_Value); |
| 8422 | |
| 8423 | /* Outputs for Atomic SubSystem: '<S141>/If_Then_Else1' */ |
| 8424 | |
| 8425 | /* Constant: '<S102>/CPV' */ |
| 8426 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_b, L4_MABX_P.CPV_Value, |
| 8427 | L4_MABX_B.Add_e, &L4_MABX_B.If_Then_Else1_b); |
| 8428 | |
| 8429 | /* End of Outputs for SubSystem: '<S141>/If_Then_Else1' */ |
| 8430 | |
| 8431 | /* Outputs for Atomic SubSystem: '<S141>/If_Then_Else' */ |
| 8432 | |
| 8433 | /* Constant: '<S102>/CPV6' */ |
| 8434 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_gi, L4_MABX_P.CPV6_Value, |
| 8435 | L4_MABX_B.If_Then_Else1_b.Switch, |
| 8436 | &L4_MABX_B.If_Then_Else_n); |
| 8437 | |
| 8438 | /* End of Outputs for SubSystem: '<S141>/If_Then_Else' */ |
| 8439 | } else { |
| 8440 | if (L4_MABX_DW.Bendix_2C2_brake_application_pr) { |
| 8441 | /* Disable for Enabled SubSystem: '<S112>/Calculate_D_term' */ |
| 8442 | if (L4_MABX_DW.Calculate_D_term.Calculate_D_term_MODE) { |
| 8443 | L4_Calculate_D_term_Disable(&L4_MABX_B.Calculate_D_term, |
| 8444 | &L4_MABX_DW.Calculate_D_term, &L4_MABX_P.Calculate_D_term); |
| 8445 | } |
| 8446 | |
| 8447 | /* End of Disable for SubSystem: '<S112>/Calculate_D_term' */ |
| 8448 | |
| 8449 | /* Disable for Enabled SubSystem: '<S112>/Calculate_I_term' */ |
| 8450 | if (L4_MABX_DW.Calculate_I_term.Calculate_I_term_MODE) { |
| 8451 | L4_Calculate_I_term_Disable(&L4_MABX_B.Calculate_I_term, |
| 8452 | &L4_MABX_DW.Calculate_I_term, &L4_MABX_P.Calculate_I_term); |
| 8453 | } |
| 8454 | |
| 8455 | /* End of Disable for SubSystem: '<S112>/Calculate_I_term' */ |
| 8456 | |
| 8457 | /* Disable for Outport: '<S102>/PID_output' */ |
| 8458 | L4_MABX_B.If_Then_Else_n.Switch = L4_MABX_P.PID_output_Y0; |
| 8459 | L4_MABX_DW.Bendix_2C2_brake_application_pr = false; |
| 8460 | } |
| 8461 | } |
| 8462 | |
| 8463 | /* End of Outputs for SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */ |
| 8464 | |
| 8465 | /* RelationalOperator: '<S387>/Compare' incorporates: |
| 8466 | * Constant: '<S387>/Constant' |
| 8467 | */ |
| 8468 | L4_MABX_B.Compare_ey = (L4_MABX_B.SFunction1_o4_bm == |
| 8469 | L4_MABX_P.CompareToConstant9_const); |
| 8470 | |
| 8471 | /* RelationalOperator: '<S384>/Compare' incorporates: |
| 8472 | * Constant: '<S384>/Constant' |
| 8473 | */ |
| 8474 | L4_MABX_B.Compare_jb = (L4_MABX_B.SFunction1_o5_b == |
| 8475 | L4_MABX_P.CompareToConstant10_const); |
| 8476 | |
| 8477 | /* RelationalOperator: '<S385>/Compare' incorporates: |
| 8478 | * Constant: '<S385>/Constant' |
| 8479 | */ |
| 8480 | L4_MABX_B.Compare_h = (L4_MABX_B.SFunction1_o6_e == |
| 8481 | L4_MABX_P.CompareToConstant11_const); |
| 8482 | |
| 8483 | /* RelationalOperator: '<S386>/Compare' incorporates: |
| 8484 | * Constant: '<S386>/Constant' |
| 8485 | */ |
| 8486 | L4_MABX_B.Compare_bp = (L4_MABX_B.SFunction1_o7_a == |
| 8487 | L4_MABX_P.CompareToConstant12_const); |
| 8488 | |
| 8489 | /* Logic: '<S347>/Logical Operator2' */ |
| 8490 | L4_MABX_B.LogicalOperator2_f = (L4_MABX_B.Compare_ey || L4_MABX_B.Compare_jb || |
| 8491 | L4_MABX_B.Compare_h || L4_MABX_B.Compare_bp); |
| 8492 | |
| 8493 | /* UnitDelay: '<S389>/Unit_Delay' */ |
| 8494 | L4_MABX_B.Unit_Delay_ot = L4_MABX_DW.Unit_Delay_DSTATE_cx; |
| 8495 | |
| 8496 | /* Logic: '<S389>/Logical Operator1' */ |
| 8497 | L4_MABX_B.LogicalOperator1_j = !L4_MABX_B.Unit_Delay_ot; |
| 8498 | |
| 8499 | /* Logic: '<S389>/Logical Operator' */ |
| 8500 | L4_MABX_B.LogicalOperator_fl = (L4_MABX_B.LogicalOperator2_f && |
| 8501 | L4_MABX_B.LogicalOperator1_j); |
| 8502 | |
| 8503 | /* UnitDelay: '<S390>/Unit_Delay' */ |
| 8504 | L4_MABX_B.Unit_Delay_jz = L4_MABX_DW.Unit_Delay_DSTATE_d0; |
| 8505 | |
| 8506 | /* Logic: '<S390>/Logical Operator1' */ |
| 8507 | L4_MABX_B.LogicalOperator1_ao = (L4_MABX_B.LogicalOperator_fl || |
| 8508 | L4_MABX_B.Unit_Delay_jz); |
| 8509 | |
| 8510 | /* UnitDelay: '<S347>/Unit_Delay' */ |
| 8511 | L4_MABX_B.Unit_Delay_k = L4_MABX_DW.Unit_Delay_DSTATE_e; |
| 8512 | |
| 8513 | /* MinMax: '<S347>/MinMax' */ |
| 8514 | DeltaTime = L4_MABX_B.Unit_Delay_k; |
| 8515 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_ee; |
| 8516 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8517 | PositionFinalLimited = DeltaTime; |
| 8518 | } |
| 8519 | |
| 8520 | L4_MABX_B.MinMax_d = PositionFinalLimited; |
| 8521 | |
| 8522 | /* End of MinMax: '<S347>/MinMax' */ |
| 8523 | |
| 8524 | /* Outputs for Atomic SubSystem: '<S347>/If_Then_Else4' */ |
| 8525 | |
| 8526 | /* Constant: '<S347>/STABILITY_ACTIVE_VSPD_TARGET_APV' incorporates: |
| 8527 | * Constant: '<S347>/Constant4' |
| 8528 | */ |
| 8529 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator2_f, |
| 8530 | L4_MABX_P.STABILITY_ACTIVE_VSPD_TARGET_AP, |
| 8531 | L4_MABX_P.Constant4_Value_n, &L4_MABX_B.If_Then_Else4_h); |
| 8532 | |
| 8533 | /* End of Outputs for SubSystem: '<S347>/If_Then_Else4' */ |
| 8534 | |
| 8535 | /* UnitDelay: '<S394>/FixPt Unit Delay2' */ |
| 8536 | L4_MABX_B.FixPtUnitDelay2_b = L4_MABX_DW.FixPtUnitDelay2_DSTATE_a; |
| 8537 | |
| 8538 | /* UnitDelay: '<S394>/FixPt Unit Delay1' */ |
| 8539 | L4_MABX_B.Xold_h = L4_MABX_DW.FixPtUnitDelay1_DSTATE_hj; |
| 8540 | |
| 8541 | /* Switch: '<S394>/Init' */ |
| 8542 | if (L4_MABX_B.FixPtUnitDelay2_b != 0) { |
| 8543 | L4_MABX_B.Init_i = L4_MABX_B.If_Then_Else4_h.Switch; |
| 8544 | } else { |
| 8545 | L4_MABX_B.Init_i = L4_MABX_B.Xold_h; |
| 8546 | } |
| 8547 | |
| 8548 | /* End of Switch: '<S394>/Init' */ |
| 8549 | |
| 8550 | /* Abs: '<S390>/Abs' incorporates: |
| 8551 | * Constant: '<S347>/STABILITY_CTRL_SLEW_INC_APV' |
| 8552 | */ |
| 8553 | L4_MABX_B.Abs_e = fabs(L4_MABX_P.STABILITY_CTRL_SLEW_INC_APV_Val); |
| 8554 | |
| 8555 | /* DigitalClock: '<S391>/Digital Clock' */ |
| 8556 | L4_MABX_B.DigitalClock = L4_MABX_M->Timing.t[0]; |
| 8557 | |
| 8558 | /* UnitDelay: '<S391>/Unit_Delay' */ |
| 8559 | L4_MABX_B.Unit_Delay_d = L4_MABX_DW.Unit_Delay_DSTATE_m; |
| 8560 | |
| 8561 | /* Sum: '<S391>/Subtract' */ |
| 8562 | L4_MABX_B.Subtract_l = L4_MABX_B.DigitalClock - L4_MABX_B.Unit_Delay_d; |
| 8563 | |
| 8564 | /* Product: '<S390>/Product1' */ |
| 8565 | L4_MABX_B.Product1_hp = L4_MABX_B.Abs_e * L4_MABX_B.Subtract_l; |
| 8566 | |
| 8567 | /* Sum: '<S390>/Add1' */ |
| 8568 | L4_MABX_B.Add1_n = L4_MABX_B.Init_i + L4_MABX_B.Product1_hp; |
| 8569 | |
| 8570 | /* MinMax: '<S390>/MinMax2' */ |
| 8571 | DeltaTime = L4_MABX_B.If_Then_Else4_h.Switch; |
| 8572 | PositionFinalLimited = L4_MABX_B.Add1_n; |
| 8573 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8574 | PositionFinalLimited = DeltaTime; |
| 8575 | } |
| 8576 | |
| 8577 | L4_MABX_B.MinMax2_g = PositionFinalLimited; |
| 8578 | |
| 8579 | /* End of MinMax: '<S390>/MinMax2' */ |
| 8580 | |
| 8581 | /* Abs: '<S390>/Abs1' incorporates: |
| 8582 | * Constant: '<S347>/STABILITY_CTRL_SLEW_DEC_APV' |
| 8583 | */ |
| 8584 | L4_MABX_B.Abs1_h = fabs(L4_MABX_P.STABILITY_CTRL_SLEW_DEC_APV_Val); |
| 8585 | |
| 8586 | /* Product: '<S390>/Product2' */ |
| 8587 | L4_MABX_B.Product2_c = L4_MABX_B.Subtract_l * L4_MABX_B.Abs1_h; |
| 8588 | |
| 8589 | /* Sum: '<S390>/Subtract1' */ |
| 8590 | L4_MABX_B.Subtract1_n = L4_MABX_B.Init_i - L4_MABX_B.Product2_c; |
| 8591 | |
| 8592 | /* MinMax: '<S390>/MinMax1' */ |
| 8593 | DeltaTime = L4_MABX_B.MinMax2_g; |
| 8594 | PositionFinalLimited = L4_MABX_B.Subtract1_n; |
| 8595 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8596 | PositionFinalLimited = DeltaTime; |
| 8597 | } |
| 8598 | |
| 8599 | L4_MABX_B.MinMax1_h = PositionFinalLimited; |
| 8600 | |
| 8601 | /* End of MinMax: '<S390>/MinMax1' */ |
| 8602 | |
| 8603 | /* Outputs for Atomic SubSystem: '<S390>/If_Then_Else' */ |
| 8604 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_ao, L4_MABX_B.MinMax_d, |
| 8605 | L4_MABX_B.MinMax1_h, &L4_MABX_B.If_Then_Else_m4); |
| 8606 | |
| 8607 | /* End of Outputs for SubSystem: '<S390>/If_Then_Else' */ |
| 8608 | |
| 8609 | /* RelationalOperator: '<S375>/Compare' incorporates: |
| 8610 | * Constant: '<S375>/Constant' |
| 8611 | */ |
| 8612 | L4_MABX_B.Compare_d3 = (L4_MABX_B.ACCDistanceAlertSignal == |
| 8613 | L4_MABX_P.CompareToConstant3_const); |
| 8614 | |
| 8615 | /* RelationalOperator: '<S376>/Compare' incorporates: |
| 8616 | * Constant: '<S376>/Constant' |
| 8617 | */ |
| 8618 | L4_MABX_B.Compare_dv = (L4_MABX_B.ForwardCollisionWarning == |
| 8619 | L4_MABX_P.CompareToConstant8_const); |
| 8620 | |
| 8621 | /* Logic: '<S345>/Logical Operator1' */ |
| 8622 | L4_MABX_B.LogicalOperator1_g = (L4_MABX_B.Compare_d3 || L4_MABX_B.Compare_dv); |
| 8623 | |
| 8624 | /* UnitDelay: '<S378>/Unit_Delay' */ |
| 8625 | L4_MABX_B.Unit_Delay_h = L4_MABX_DW.Unit_Delay_DSTATE_iy; |
| 8626 | |
| 8627 | /* Logic: '<S378>/Logical Operator1' */ |
| 8628 | L4_MABX_B.LogicalOperator1_jp = !L4_MABX_B.Unit_Delay_h; |
| 8629 | |
| 8630 | /* Logic: '<S378>/Logical Operator' */ |
| 8631 | L4_MABX_B.LogicalOperator_kf = (L4_MABX_B.LogicalOperator1_g && |
| 8632 | L4_MABX_B.LogicalOperator1_jp); |
| 8633 | |
| 8634 | /* UnitDelay: '<S379>/Unit_Delay' */ |
| 8635 | L4_MABX_B.Unit_Delay_c4 = L4_MABX_DW.Unit_Delay_DSTATE_mv; |
| 8636 | |
| 8637 | /* Logic: '<S379>/Logical Operator1' */ |
| 8638 | L4_MABX_B.LogicalOperator1_l = (L4_MABX_B.LogicalOperator_kf || |
| 8639 | L4_MABX_B.Unit_Delay_c4); |
| 8640 | |
| 8641 | /* UnitDelay: '<S345>/Unit_Delay' */ |
| 8642 | L4_MABX_B.Unit_Delay_n = L4_MABX_DW.Unit_Delay_DSTATE_g; |
| 8643 | |
| 8644 | /* MinMax: '<S345>/MinMax' */ |
| 8645 | DeltaTime = L4_MABX_B.Unit_Delay_n; |
| 8646 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_ee; |
| 8647 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8648 | PositionFinalLimited = DeltaTime; |
| 8649 | } |
| 8650 | |
| 8651 | L4_MABX_B.MinMax_n = PositionFinalLimited; |
| 8652 | |
| 8653 | /* End of MinMax: '<S345>/MinMax' */ |
| 8654 | |
| 8655 | /* Outputs for Atomic SubSystem: '<S345>/If_Then_Else4' */ |
| 8656 | |
| 8657 | /* Constant: '<S345>/FCW_ACTIVE_VSPD_TARGET_APV' incorporates: |
| 8658 | * Constant: '<S345>/Constant4' |
| 8659 | */ |
| 8660 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_g, |
| 8661 | L4_MABX_P.FCW_ACTIVE_VSPD_TARGET_APV_Valu, |
| 8662 | L4_MABX_P.Constant4_Value_b, &L4_MABX_B.If_Then_Else4_e); |
| 8663 | |
| 8664 | /* End of Outputs for SubSystem: '<S345>/If_Then_Else4' */ |
| 8665 | |
| 8666 | /* UnitDelay: '<S383>/FixPt Unit Delay2' */ |
| 8667 | L4_MABX_B.FixPtUnitDelay2_pl = L4_MABX_DW.FixPtUnitDelay2_DSTATE_i; |
| 8668 | |
| 8669 | /* UnitDelay: '<S383>/FixPt Unit Delay1' */ |
| 8670 | L4_MABX_B.Xold_fv = L4_MABX_DW.FixPtUnitDelay1_DSTATE_hq; |
| 8671 | |
| 8672 | /* Switch: '<S383>/Init' */ |
| 8673 | if (L4_MABX_B.FixPtUnitDelay2_pl != 0) { |
| 8674 | L4_MABX_B.Init_b = L4_MABX_B.If_Then_Else4_e.Switch; |
| 8675 | } else { |
| 8676 | L4_MABX_B.Init_b = L4_MABX_B.Xold_fv; |
| 8677 | } |
| 8678 | |
| 8679 | /* End of Switch: '<S383>/Init' */ |
| 8680 | |
| 8681 | /* Abs: '<S379>/Abs' incorporates: |
| 8682 | * Constant: '<S345>/FCW_CTRL_SLEW_INC_APV' |
| 8683 | */ |
| 8684 | L4_MABX_B.Abs_ez = fabs(L4_MABX_P.FCW_CTRL_SLEW_INC_APV_Value); |
| 8685 | |
| 8686 | /* DigitalClock: '<S380>/Digital Clock' */ |
| 8687 | L4_MABX_B.DigitalClock_b = L4_MABX_M->Timing.t[0]; |
| 8688 | |
| 8689 | /* UnitDelay: '<S380>/Unit_Delay' */ |
| 8690 | L4_MABX_B.Unit_Delay_nx = L4_MABX_DW.Unit_Delay_DSTATE_b; |
| 8691 | |
| 8692 | /* Sum: '<S380>/Subtract' */ |
| 8693 | L4_MABX_B.Subtract_i = L4_MABX_B.DigitalClock_b - L4_MABX_B.Unit_Delay_nx; |
| 8694 | |
| 8695 | /* Product: '<S379>/Product1' */ |
| 8696 | L4_MABX_B.Product1_i = L4_MABX_B.Abs_ez * L4_MABX_B.Subtract_i; |
| 8697 | |
| 8698 | /* Sum: '<S379>/Add1' */ |
| 8699 | L4_MABX_B.Add1_b = L4_MABX_B.Init_b + L4_MABX_B.Product1_i; |
| 8700 | |
| 8701 | /* MinMax: '<S379>/MinMax2' */ |
| 8702 | DeltaTime = L4_MABX_B.If_Then_Else4_e.Switch; |
| 8703 | PositionFinalLimited = L4_MABX_B.Add1_b; |
| 8704 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8705 | PositionFinalLimited = DeltaTime; |
| 8706 | } |
| 8707 | |
| 8708 | L4_MABX_B.MinMax2_k = PositionFinalLimited; |
| 8709 | |
| 8710 | /* End of MinMax: '<S379>/MinMax2' */ |
| 8711 | |
| 8712 | /* Abs: '<S379>/Abs1' incorporates: |
| 8713 | * Constant: '<S345>/FCW_CTRL_SLEW_DEC_APV' |
| 8714 | */ |
| 8715 | L4_MABX_B.Abs1_c = fabs(L4_MABX_P.FCW_CTRL_SLEW_DEC_APV_Value); |
| 8716 | |
| 8717 | /* Product: '<S379>/Product2' */ |
| 8718 | L4_MABX_B.Product2_n = L4_MABX_B.Subtract_i * L4_MABX_B.Abs1_c; |
| 8719 | |
| 8720 | /* Sum: '<S379>/Subtract1' */ |
| 8721 | L4_MABX_B.Subtract1_h = L4_MABX_B.Init_b - L4_MABX_B.Product2_n; |
| 8722 | |
| 8723 | /* MinMax: '<S379>/MinMax1' */ |
| 8724 | DeltaTime = L4_MABX_B.MinMax2_k; |
| 8725 | PositionFinalLimited = L4_MABX_B.Subtract1_h; |
| 8726 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8727 | PositionFinalLimited = DeltaTime; |
| 8728 | } |
| 8729 | |
| 8730 | L4_MABX_B.MinMax1_j = PositionFinalLimited; |
| 8731 | |
| 8732 | /* End of MinMax: '<S379>/MinMax1' */ |
| 8733 | |
| 8734 | /* Outputs for Atomic SubSystem: '<S379>/If_Then_Else' */ |
| 8735 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_l, L4_MABX_B.MinMax_n, |
| 8736 | L4_MABX_B.MinMax1_j, &L4_MABX_B.If_Then_Else_bf); |
| 8737 | |
| 8738 | /* End of Outputs for SubSystem: '<S379>/If_Then_Else' */ |
| 8739 | |
| 8740 | /* RateTransition: '<S81>/TmpRTBAtSignal Conversion3Inport1' */ |
| 8741 | if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) { |
| 8742 | L4_MABX_B.pathSpdLimit_a = L4_MABX_DW.TmpRTBAtSignalConversion3Inport; |
| 8743 | } |
| 8744 | |
| 8745 | /* MultiPortSwitch: '<S81>/Multiport Switch' incorporates: |
| 8746 | * Constant: '<S81>/LONG_SPEED_SRC_SELECTOR_APV' |
| 8747 | */ |
| 8748 | switch (LONG_SPEED_SRC_SELECTOR_APV) { |
| 8749 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH: |
| 8750 | /* SignalConversion: '<S81>/Signal Conversion3' */ |
| 8751 | L4_MABX_B.Vehicle_speed_abs_max_e = L4_MABX_B.pathSpdLimit_a; |
| 8752 | L4_MABX_B.Vehicle_speed_abs_max = L4_MABX_B.Vehicle_speed_abs_max_e; |
| 8753 | break; |
| 8754 | |
| 8755 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE: |
| 8756 | /* SignalConversion: '<S81>/Signal Conversion8' incorporates: |
| 8757 | * Constant: '<S81>/VSPD_ABS_MAX_APV' |
| 8758 | */ |
| 8759 | L4_MABX_B.Vehicle_speed_abs_max_j = L4_MABX_P.VSPD_ABS_MAX_APV_Value; |
| 8760 | L4_MABX_B.Vehicle_speed_abs_max = L4_MABX_B.Vehicle_speed_abs_max_j; |
| 8761 | break; |
| 8762 | |
| 8763 | default: |
| 8764 | /* SignalConversion: '<S81>/Signal Conversion15' incorporates: |
| 8765 | * Constant: '<S81>/CPV1' |
| 8766 | */ |
| 8767 | L4_MABX_B.Vehicle_speed_abs_max_g = L4_MABX_P.CPV1_Value; |
| 8768 | L4_MABX_B.Vehicle_speed_abs_max = L4_MABX_B.Vehicle_speed_abs_max_g; |
| 8769 | break; |
| 8770 | } |
| 8771 | |
| 8772 | /* RelationalOperator: '<S341>/Compare' incorporates: |
| 8773 | * Constant: '<S341>/Constant' |
| 8774 | */ |
| 8775 | L4_MABX_B.Compare_jr = (L4_MABX_B.SFunction1_o7_oi == |
| 8776 | L4_MABX_P.Constant_Value_a); |
| 8777 | |
| 8778 | /* RateTransition: '<S81>/TmpRTBAtSignal Conversion2Inport1' */ |
| 8779 | if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) { |
| 8780 | L4_MABX_B.distance_o = L4_MABX_DW.TmpRTBAtSignalConversion2Inport; |
| 8781 | } |
| 8782 | |
| 8783 | /* MultiPortSwitch: '<S81>/Multiport Switch' incorporates: |
| 8784 | * Constant: '<S81>/LONG_SPEED_SRC_SELECTOR_APV' |
| 8785 | */ |
| 8786 | switch (LONG_SPEED_SRC_SELECTOR_APV) { |
| 8787 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH: |
| 8788 | /* SignalConversion: '<S81>/Signal Conversion2' */ |
| 8789 | L4_MABX_B.Distance_to_achieve_speed_tar_f = L4_MABX_B.distance_o; |
| 8790 | L4_MABX_B.Distance_to_achieve_speed_targe = |
| 8791 | L4_MABX_B.Distance_to_achieve_speed_tar_f; |
| 8792 | break; |
| 8793 | |
| 8794 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE: |
| 8795 | /* SignalConversion: '<S81>/Signal Conversion7' incorporates: |
| 8796 | * Constant: '<S81>/DISTANCE_M' |
| 8797 | */ |
| 8798 | L4_MABX_B.Distance_to_achieve_speed_tar_j = DISTANCE_M; |
| 8799 | L4_MABX_B.Distance_to_achieve_speed_targe = |
| 8800 | L4_MABX_B.Distance_to_achieve_speed_tar_j; |
| 8801 | break; |
| 8802 | |
| 8803 | default: |
| 8804 | /* SignalConversion: '<S81>/Signal Conversion14' incorporates: |
| 8805 | * Constant: '<S81>/CPV' |
| 8806 | */ |
| 8807 | L4_MABX_B.Distance_to_achieve_speed_tar_m = L4_MABX_P.CPV_Value_ia; |
| 8808 | L4_MABX_B.Distance_to_achieve_speed_targe = |
| 8809 | L4_MABX_B.Distance_to_achieve_speed_tar_m; |
| 8810 | break; |
| 8811 | } |
| 8812 | |
| 8813 | /* UnitDelay: '<S342>/Delay Input1' */ |
| 8814 | L4_MABX_B.Uk1[0] = L4_MABX_DW.DelayInput1_DSTATE[0]; |
| 8815 | L4_MABX_B.Uk1[1] = L4_MABX_DW.DelayInput1_DSTATE[1]; |
| 8816 | |
| 8817 | /* RelationalOperator: '<S342>/FixPt Relational Operator' */ |
| 8818 | L4_MABX_B.FixPtRelationalOperator_d[0] = |
| 8819 | (L4_MABX_B.Distance_to_achieve_speed_targe != L4_MABX_B.Uk1[0]); |
| 8820 | L4_MABX_B.FixPtRelationalOperator_d[1] = (L4_MABX_B.Vehicle_speed_target_o != |
| 8821 | L4_MABX_B.Uk1[1]); |
| 8822 | |
| 8823 | /* Logic: '<S81>/Logical Operator1' */ |
| 8824 | L4_MABX_B.LogicalOperator1_ja = (L4_MABX_B.FixPtRelationalOperator_d[0] || |
| 8825 | L4_MABX_B.FixPtRelationalOperator_d[1]); |
| 8826 | |
| 8827 | /* Saturate: '<S344>/Saturation5' */ |
| 8828 | DeltaTime = L4_MABX_B.SFunction1_o1_ee; |
| 8829 | Time56 = L4_MABX_P.Saturation5_LowerSat; |
| 8830 | PositionFinalLimited = L4_MABX_P.Saturation5_UpperSat; |
| 8831 | if (DeltaTime > PositionFinalLimited) { |
| 8832 | L4_MABX_B.Saturation5 = PositionFinalLimited; |
| 8833 | } else if (DeltaTime < Time56) { |
| 8834 | L4_MABX_B.Saturation5 = Time56; |
| 8835 | } else { |
| 8836 | L4_MABX_B.Saturation5 = DeltaTime; |
| 8837 | } |
| 8838 | |
| 8839 | /* End of Saturate: '<S344>/Saturation5' */ |
| 8840 | |
| 8841 | /* MinMax: '<S344>/MinMax6' incorporates: |
| 8842 | * Constant: '<S344>/MIN_VSPD_SIGMOID_INITIAL_KPH_APV' |
| 8843 | */ |
| 8844 | DeltaTime = L4_MABX_B.Saturation5; |
| 8845 | PositionFinalLimited = L4_MABX_P.MIN_VSPD_SIGMOID_INITIAL_KPH_AP; |
| 8846 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8847 | PositionFinalLimited = DeltaTime; |
| 8848 | } |
| 8849 | |
| 8850 | L4_MABX_B.MinMax6 = PositionFinalLimited; |
| 8851 | |
| 8852 | /* End of MinMax: '<S344>/MinMax6' */ |
| 8853 | |
| 8854 | /* Gain: '<S344>/Gain1' */ |
| 8855 | L4_MABX_B.Gain1_e = L4_MABX_P.Gain1_Gain_a * L4_MABX_B.MinMax6; |
| 8856 | |
| 8857 | /* Saturate: '<S344>/Saturation4' */ |
| 8858 | DeltaTime = L4_MABX_B.Vehicle_speed_target_o; |
| 8859 | Time56 = L4_MABX_P.Saturation4_LowerSat; |
| 8860 | PositionFinalLimited = L4_MABX_P.Saturation4_UpperSat; |
| 8861 | if (DeltaTime > PositionFinalLimited) { |
| 8862 | L4_MABX_B.VSPD_TARGET_KPH_APV_gu = PositionFinalLimited; |
| 8863 | } else if (DeltaTime < Time56) { |
| 8864 | L4_MABX_B.VSPD_TARGET_KPH_APV_gu = Time56; |
| 8865 | } else { |
| 8866 | L4_MABX_B.VSPD_TARGET_KPH_APV_gu = DeltaTime; |
| 8867 | } |
| 8868 | |
| 8869 | /* End of Saturate: '<S344>/Saturation4' */ |
| 8870 | |
| 8871 | /* MinMax: '<S344>/MinMax1' incorporates: |
| 8872 | * Constant: '<S344>/MIN_VSPD_SIGMOID_FINAL_KPH_APV' |
| 8873 | */ |
| 8874 | DeltaTime = L4_MABX_B.VSPD_TARGET_KPH_APV_gu; |
| 8875 | PositionFinalLimited = L4_MABX_P.MIN_VSPD_SIGMOID_FINAL_KPH_APV_; |
| 8876 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 8877 | PositionFinalLimited = DeltaTime; |
| 8878 | } |
| 8879 | |
| 8880 | L4_MABX_B.MinMax1_f = PositionFinalLimited; |
| 8881 | |
| 8882 | /* End of MinMax: '<S344>/MinMax1' */ |
| 8883 | |
| 8884 | /* Gain: '<S344>/Gain2' */ |
| 8885 | L4_MABX_B.Gain2 = L4_MABX_P.Gain2_Gain_k * L4_MABX_B.MinMax1_f; |
| 8886 | |
| 8887 | /* Saturate: '<S344>/Saturation6' */ |
| 8888 | DeltaTime = SPN1810_LongitudinalAcceleration; |
| 8889 | Time56 = L4_MABX_P.Saturation6_LowerSat; |
| 8890 | PositionFinalLimited = L4_MABX_P.Saturation6_UpperSat; |
| 8891 | if (DeltaTime > PositionFinalLimited) { |
| 8892 | L4_MABX_B.Saturation6 = PositionFinalLimited; |
| 8893 | } else if (DeltaTime < Time56) { |
| 8894 | L4_MABX_B.Saturation6 = Time56; |
| 8895 | } else { |
| 8896 | L4_MABX_B.Saturation6 = DeltaTime; |
| 8897 | } |
| 8898 | |
| 8899 | /* End of Saturate: '<S344>/Saturation6' */ |
| 8900 | |
| 8901 | /* MultiPortSwitch: '<S81>/Multiport Switch' incorporates: |
| 8902 | * Constant: '<S81>/LONG_SPEED_SRC_SELECTOR_APV' |
| 8903 | */ |
| 8904 | switch (LONG_SPEED_SRC_SELECTOR_APV) { |
| 8905 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH: |
| 8906 | /* SignalConversion: '<S81>/Signal Conversion10' incorporates: |
| 8907 | * Constant: '<S81>/CPV3' |
| 8908 | */ |
| 8909 | L4_MABX_B.Acceleration_target_ms2_d = L4_MABX_P.CPV3_Value_l; |
| 8910 | L4_MABX_B.Acceleration_target_ms2 = L4_MABX_B.Acceleration_target_ms2_d; |
| 8911 | break; |
| 8912 | |
| 8913 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE: |
| 8914 | /* SignalConversion: '<S81>/Signal Conversion5' incorporates: |
| 8915 | * Constant: '<S81>/VEH_ACCEL_TARGET_APV' |
| 8916 | */ |
| 8917 | L4_MABX_B.Acceleration_target_ms2_h = L4_MABX_P.VEH_ACCEL_TARGET_APV_Value; |
| 8918 | L4_MABX_B.Acceleration_target_ms2 = L4_MABX_B.Acceleration_target_ms2_h; |
| 8919 | break; |
| 8920 | |
| 8921 | default: |
| 8922 | /* SignalConversion: '<S81>/Signal Conversion11' incorporates: |
| 8923 | * Constant: '<S81>/CPV2' |
| 8924 | */ |
| 8925 | L4_MABX_B.Acceleration_target_ms2_f = L4_MABX_P.CPV2_Value; |
| 8926 | L4_MABX_B.Acceleration_target_ms2 = L4_MABX_B.Acceleration_target_ms2_f; |
| 8927 | break; |
| 8928 | } |
| 8929 | |
| 8930 | /* Saturate: '<S344>/Saturation7' */ |
| 8931 | DeltaTime = L4_MABX_B.Acceleration_target_ms2; |
| 8932 | Time56 = L4_MABX_P.Saturation7_LowerSat; |
| 8933 | PositionFinalLimited = L4_MABX_P.Saturation7_UpperSat; |
| 8934 | if (DeltaTime > PositionFinalLimited) { |
| 8935 | L4_MABX_B.Saturation7 = PositionFinalLimited; |
| 8936 | } else if (DeltaTime < Time56) { |
| 8937 | L4_MABX_B.Saturation7 = Time56; |
| 8938 | } else { |
| 8939 | L4_MABX_B.Saturation7 = DeltaTime; |
| 8940 | } |
| 8941 | |
| 8942 | /* End of Saturate: '<S344>/Saturation7' */ |
| 8943 | |
| 8944 | /* Saturate: '<S344>/Saturation1' incorporates: |
| 8945 | * Constant: '<S81>/VEH_JERK_INITIAL_APV' |
| 8946 | */ |
| 8947 | DeltaTime = L4_MABX_P.VEH_JERK_INITIAL_APV_Value; |
| 8948 | Time56 = L4_MABX_P.Saturation1_LowerSat_b; |
| 8949 | PositionFinalLimited = L4_MABX_P.Saturation1_UpperSat_o; |
| 8950 | if (DeltaTime > PositionFinalLimited) { |
| 8951 | L4_MABX_B.Saturation1 = PositionFinalLimited; |
| 8952 | } else if (DeltaTime < Time56) { |
| 8953 | L4_MABX_B.Saturation1 = Time56; |
| 8954 | } else { |
| 8955 | L4_MABX_B.Saturation1 = DeltaTime; |
| 8956 | } |
| 8957 | |
| 8958 | /* End of Saturate: '<S344>/Saturation1' */ |
| 8959 | |
| 8960 | /* MultiPortSwitch: '<S81>/Multiport Switch' incorporates: |
| 8961 | * Constant: '<S81>/LONG_SPEED_SRC_SELECTOR_APV' |
| 8962 | */ |
| 8963 | switch (LONG_SPEED_SRC_SELECTOR_APV) { |
| 8964 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH: |
| 8965 | /* SignalConversion: '<S81>/Signal Conversion13' incorporates: |
| 8966 | * Constant: '<S81>/CPV4' |
| 8967 | */ |
| 8968 | L4_MABX_B.Jerk_target_ms3_g = L4_MABX_P.CPV4_Value_k; |
| 8969 | L4_MABX_B.Jerk_target_ms3 = L4_MABX_B.Jerk_target_ms3_g; |
| 8970 | break; |
| 8971 | |
| 8972 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE: |
| 8973 | /* SignalConversion: '<S81>/Signal Conversion6' incorporates: |
| 8974 | * Constant: '<S81>/VEH_JERK_TARGET_APV' |
| 8975 | */ |
| 8976 | L4_MABX_B.Jerk_target_ms3_d = L4_MABX_P.VEH_JERK_TARGET_APV_Value; |
| 8977 | L4_MABX_B.Jerk_target_ms3 = L4_MABX_B.Jerk_target_ms3_d; |
| 8978 | break; |
| 8979 | |
| 8980 | default: |
| 8981 | /* SignalConversion: '<S81>/Signal Conversion12' incorporates: |
| 8982 | * Constant: '<S81>/CPV5' |
| 8983 | */ |
| 8984 | L4_MABX_B.Jerk_target_ms3_l = L4_MABX_P.CPV5_Value_n; |
| 8985 | L4_MABX_B.Jerk_target_ms3 = L4_MABX_B.Jerk_target_ms3_l; |
| 8986 | break; |
| 8987 | } |
| 8988 | |
| 8989 | /* Saturate: '<S344>/Saturation2' */ |
| 8990 | DeltaTime = L4_MABX_B.Jerk_target_ms3; |
| 8991 | Time56 = L4_MABX_P.Saturation2_LowerSat; |
| 8992 | PositionFinalLimited = L4_MABX_P.Saturation2_UpperSat; |
| 8993 | if (DeltaTime > PositionFinalLimited) { |
| 8994 | L4_MABX_B.Saturation2 = PositionFinalLimited; |
| 8995 | } else if (DeltaTime < Time56) { |
| 8996 | L4_MABX_B.Saturation2 = Time56; |
| 8997 | } else { |
| 8998 | L4_MABX_B.Saturation2 = DeltaTime; |
| 8999 | } |
| 9000 | |
| 9001 | /* End of Saturate: '<S344>/Saturation2' */ |
| 9002 | |
| 9003 | /* Chart: '<S344>/VehicleSpeedSetpointDynamicCalculation' */ |
| 9004 | /* Gateway: L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/VehicleSpeedSetpointDynamicCalculation */ |
| 9005 | /* During: L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/VehicleSpeedSetpointDynamicCalculation */ |
| 9006 | /* Entry Internal: L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/VehicleSpeedSetpointDynamicCalculation */ |
| 9007 | /* Transition: '<S359>:88' */ |
| 9008 | if (L4_MABX_B.LogicalOperator1_ja) { |
| 9009 | /* Transition: '<S359>:89' */ |
| 9010 | /* Transition: '<S359>:39' */ |
| 9011 | PositionFinalLimited = L4_MABX_B.Distance_to_achieve_speed_targe; |
| 9012 | if ((0.001 > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 9013 | PositionFinalLimited = 0.001; |
| 9014 | } |
| 9015 | |
| 9016 | Time56 = L4_MABX_B.Gain1_e; |
| 9017 | if ((0.1 > Time56) || rtIsNaN(Time56)) { |
| 9018 | L4_MABX_DW.VelocityInitialLimited = 0.1; |
| 9019 | } else { |
| 9020 | L4_MABX_DW.VelocityInitialLimited = Time56; |
| 9021 | } |
| 9022 | |
| 9023 | Time56 = L4_MABX_B.Gain2; |
| 9024 | if ((0.1 > Time56) || rtIsNaN(Time56)) { |
| 9025 | L4_MABX_DW.VelocityFinalLimited = 0.1; |
| 9026 | } else { |
| 9027 | L4_MABX_DW.VelocityFinalLimited = Time56; |
| 9028 | } |
| 9029 | |
| 9030 | L4_MABX_DW.TimeFinal = 2.0 * PositionFinalLimited / |
| 9031 | (L4_MABX_DW.VelocityInitialLimited + L4_MABX_DW.VelocityFinalLimited); |
| 9032 | Time56 = L4_MABX_DW.TimeFinal; |
| 9033 | if ((0.007 > Time56) || rtIsNaN(Time56)) { |
| 9034 | L4_MABX_DW.TimeFinal = 0.007; |
| 9035 | } else { |
| 9036 | L4_MABX_DW.TimeFinal = Time56; |
| 9037 | } |
| 9038 | |
| 9039 | AccelerationAverage = (L4_MABX_DW.VelocityFinalLimited - |
| 9040 | L4_MABX_DW.VelocityInitialLimited) / L4_MABX_DW.TimeFinal; |
| 9041 | L4_MABX_DW.TimeFinal *= 2.0; |
| 9042 | if (L4_MABX_DW.VelocityFinalLimited > L4_MABX_DW.VelocityInitialLimited) { |
| 9043 | /* Transition: '<S359>:238' */ |
| 9044 | /* Transition: '<S359>:240' */ |
| 9045 | Time56 = L4_MABX_B.Saturation6; |
| 9046 | if ((AccelerationAverage < Time56) || rtIsNaN(Time56)) { |
| 9047 | Time56 = AccelerationAverage; |
| 9048 | } |
| 9049 | |
| 9050 | if ((0.0 > Time56) || rtIsNaN(Time56)) { |
| 9051 | L4_MABX_DW.AccelerationInitialLimited = 0.0; |
| 9052 | } else { |
| 9053 | L4_MABX_DW.AccelerationInitialLimited = Time56; |
| 9054 | } |
| 9055 | |
| 9056 | Time56 = L4_MABX_B.Saturation7; |
| 9057 | if ((AccelerationAverage < Time56) || rtIsNaN(Time56)) { |
| 9058 | Time56 = AccelerationAverage; |
| 9059 | } |
| 9060 | |
| 9061 | if ((0.0 > Time56) || rtIsNaN(Time56)) { |
| 9062 | L4_MABX_DW.AccelerationFinalLimited = 0.0; |
| 9063 | } else { |
| 9064 | L4_MABX_DW.AccelerationFinalLimited = Time56; |
| 9065 | } |
| 9066 | |
| 9067 | /* Transition: '<S359>:243' */ |
| 9068 | } else { |
| 9069 | /* Transition: '<S359>:241' */ |
| 9070 | Time56 = L4_MABX_B.Saturation6; |
| 9071 | if ((0.0 < Time56) || rtIsNaN(Time56)) { |
| 9072 | Time56 = 0.0; |
| 9073 | } |
| 9074 | |
| 9075 | if ((AccelerationAverage > Time56) || rtIsNaN(Time56)) { |
| 9076 | L4_MABX_DW.AccelerationInitialLimited = AccelerationAverage; |
| 9077 | } else { |
| 9078 | L4_MABX_DW.AccelerationInitialLimited = Time56; |
| 9079 | } |
| 9080 | |
| 9081 | Time56 = L4_MABX_B.Saturation7; |
| 9082 | if ((0.0 < Time56) || rtIsNaN(Time56)) { |
| 9083 | Time56 = 0.0; |
| 9084 | } |
| 9085 | |
| 9086 | if ((AccelerationAverage > Time56) || rtIsNaN(Time56)) { |
| 9087 | L4_MABX_DW.AccelerationFinalLimited = AccelerationAverage; |
| 9088 | } else { |
| 9089 | L4_MABX_DW.AccelerationFinalLimited = Time56; |
| 9090 | } |
| 9091 | } |
| 9092 | |
| 9093 | /* Transition: '<S359>:16' */ |
| 9094 | DeltaTimeFinal = L4_MABX_DW.TimeFinal; |
| 9095 | for (starting_index = 1U; starting_index < 16; starting_index++) { |
| 9096 | /* Transition: '<S359>:14' */ |
| 9097 | /* Transition: '<S359>:201' */ |
| 9098 | DeltaTime = ((L4_MABX_DW.VelocityInitialLimited - |
| 9099 | L4_MABX_DW.VelocityFinalLimited) + |
| 9100 | L4_MABX_DW.AccelerationFinalLimited * L4_MABX_DW.TimeFinal) * |
| 9101 | 2.0 / (L4_MABX_DW.TimeFinal * L4_MABX_DW.TimeFinal); |
| 9102 | if (L4_MABX_DW.VelocityFinalLimited > L4_MABX_DW.VelocityInitialLimited) { |
| 9103 | /* Transition: '<S359>:121' */ |
| 9104 | /* Transition: '<S359>:116' */ |
| 9105 | L4_MABX_DW.Jerk12 = L4_MABX_B.Saturation1; |
| 9106 | DeltaTime = fabs(DeltaTime); |
| 9107 | Time56 = L4_MABX_B.Saturation2; |
| 9108 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9109 | Time56 = DeltaTime; |
| 9110 | } |
| 9111 | |
| 9112 | L4_MABX_DW.Jerk56 = -Time56; |
| 9113 | |
| 9114 | /* Transition: '<S359>:120' */ |
| 9115 | } else { |
| 9116 | /* Transition: '<S359>:122' */ |
| 9117 | L4_MABX_DW.Jerk12 = -L4_MABX_B.Saturation1; |
| 9118 | DeltaTime = fabs(DeltaTime); |
| 9119 | Time56 = L4_MABX_B.Saturation2; |
| 9120 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9121 | L4_MABX_DW.Jerk56 = DeltaTime; |
| 9122 | } else { |
| 9123 | L4_MABX_DW.Jerk56 = Time56; |
| 9124 | } |
| 9125 | } |
| 9126 | |
| 9127 | /* Transition: '<S359>:275' */ |
| 9128 | L4_MABX_CalculateAcceleration34(); |
| 9129 | if (fabs(L4_MABX_DW.Acceleration34 - AccelerationAverage) < 0.001) { |
| 9130 | /* Transition: '<S359>:141' */ |
| 9131 | /* Transition: '<S359>:145' */ |
| 9132 | L4_MABX_B.TimeVectorRaw[0] = 0.0; |
| 9133 | L4_MABX_B.TimeVectorRaw[1] = 0.001; |
| 9134 | L4_MABX_B.TimeVectorRaw[2] = 0.003; |
| 9135 | L4_MABX_B.TimeVectorRaw[3] = (L4_MABX_DW.TimeFinal - 0.002) - 0.001; |
| 9136 | L4_MABX_B.TimeVectorRaw[4] = (L4_MABX_DW.TimeFinal - 0.002) + 0.001; |
| 9137 | L4_MABX_B.TimeVectorRaw[5] = L4_MABX_DW.TimeFinal; |
| 9138 | for (i = 0; i < 6; i++) { |
| 9139 | L4_MABX_B.JerkVectorRaw[i] = 0.0; |
| 9140 | } |
| 9141 | |
| 9142 | L4_MABX_B.AccelerationVectorRaw[0] = AccelerationAverage; |
| 9143 | |
| 9144 | /* Transition: '<S359>:191' */ |
| 9145 | /* Transition: '<S359>:303' */ |
| 9146 | } else { |
| 9147 | /* Transition: '<S359>:298' */ |
| 9148 | if (L4_MABX_DW.AlternateMethod) { |
| 9149 | /* Transition: '<S359>:300' */ |
| 9150 | /* Transition: '<S359>:302' */ |
| 9151 | Time56 = (L4_MABX_DW.AccelerationFinalLimited - |
| 9152 | L4_MABX_DW.Acceleration34) / L4_MABX_DW.Jerk56; |
| 9153 | if ((0.002 > Time56) || rtIsNaN(Time56)) { |
| 9154 | Time56 = 0.002; |
| 9155 | } |
| 9156 | |
| 9157 | L4_MABX_B.TimeVectorRaw[0] = 0.0; |
| 9158 | L4_MABX_B.TimeVectorRaw[1] = 0.001; |
| 9159 | L4_MABX_B.TimeVectorRaw[2] = 0.003; |
| 9160 | L4_MABX_B.TimeVectorRaw[3] = (L4_MABX_DW.TimeFinal - Time56) - 0.001; |
| 9161 | L4_MABX_B.TimeVectorRaw[4] = (L4_MABX_DW.TimeFinal - Time56) + 0.001; |
| 9162 | L4_MABX_B.TimeVectorRaw[5] = L4_MABX_DW.TimeFinal; |
| 9163 | L4_MABX_B.JerkVectorRaw[0] = 0.0; |
| 9164 | L4_MABX_B.JerkVectorRaw[1] = 0.0; |
| 9165 | L4_MABX_B.JerkVectorRaw[2] = 0.0; |
| 9166 | L4_MABX_B.JerkVectorRaw[3] = 0.0; |
| 9167 | L4_MABX_B.JerkVectorRaw[4] = L4_MABX_DW.Jerk56; |
| 9168 | L4_MABX_B.JerkVectorRaw[5] = L4_MABX_DW.Jerk56; |
| 9169 | L4_MABX_B.AccelerationVectorRaw[0] = L4_MABX_DW.Acceleration34; |
| 9170 | |
| 9171 | /* Transition: '<S359>:303' */ |
| 9172 | } else { |
| 9173 | /* Transition: '<S359>:157' */ |
| 9174 | DeltaTime = (L4_MABX_DW.Acceleration34 - |
| 9175 | L4_MABX_DW.AccelerationInitialLimited) / |
| 9176 | L4_MABX_DW.Jerk12; |
| 9177 | if ((0.002 > DeltaTime) || rtIsNaN(DeltaTime)) { |
| 9178 | DeltaTime = 0.002; |
| 9179 | } |
| 9180 | |
| 9181 | Time56 = (L4_MABX_DW.AccelerationFinalLimited - |
| 9182 | L4_MABX_DW.Acceleration34) / L4_MABX_DW.Jerk56; |
| 9183 | if ((0.002 > Time56) || rtIsNaN(Time56)) { |
| 9184 | Time56 = 0.002; |
| 9185 | } |
| 9186 | |
| 9187 | L4_MABX_B.TimeVectorRaw[0] = 0.0; |
| 9188 | L4_MABX_B.TimeVectorRaw[1] = DeltaTime - 0.001; |
| 9189 | L4_MABX_B.TimeVectorRaw[2] = DeltaTime + 0.001; |
| 9190 | L4_MABX_B.TimeVectorRaw[3] = (L4_MABX_DW.TimeFinal - Time56) - 0.001; |
| 9191 | L4_MABX_B.TimeVectorRaw[4] = (L4_MABX_DW.TimeFinal - Time56) + 0.001; |
| 9192 | L4_MABX_B.TimeVectorRaw[5] = L4_MABX_DW.TimeFinal; |
| 9193 | L4_MABX_B.JerkVectorRaw[0] = L4_MABX_DW.Jerk12; |
| 9194 | L4_MABX_B.JerkVectorRaw[1] = L4_MABX_DW.Jerk12; |
| 9195 | L4_MABX_B.JerkVectorRaw[2] = 0.0; |
| 9196 | L4_MABX_B.JerkVectorRaw[3] = 0.0; |
| 9197 | L4_MABX_B.JerkVectorRaw[4] = L4_MABX_DW.Jerk56; |
| 9198 | L4_MABX_B.JerkVectorRaw[5] = L4_MABX_DW.Jerk56; |
| 9199 | L4_MABX_B.AccelerationVectorRaw[0] = |
| 9200 | L4_MABX_DW.AccelerationInitialLimited; |
| 9201 | } |
| 9202 | } |
| 9203 | |
| 9204 | /* Transition: '<S359>:29' */ |
| 9205 | L4_MABX_B.VelocityVectorRaw[0] = L4_MABX_DW.VelocityInitialLimited; |
| 9206 | L4_MABX_B.PositionVectorRaw[0] = 0.0; |
| 9207 | for (j = 2U; j < 7; j++) { |
| 9208 | /* Transition: '<S359>:34' */ |
| 9209 | /* Transition: '<S359>:36' */ |
| 9210 | DeltaTime = L4_MABX_B.TimeVectorRaw[j - 1] - L4_MABX_B.TimeVectorRaw[j - |
| 9211 | 2]; |
| 9212 | L4_MABX_B.AccelerationVectorRaw[j - 1] = L4_MABX_B.JerkVectorRaw[j - 2] * |
| 9213 | DeltaTime + L4_MABX_B.AccelerationVectorRaw[j - 2]; |
| 9214 | L4_MABX_B.VelocityVectorRaw[j - 1] = (L4_MABX_B.AccelerationVectorRaw[j |
| 9215 | - 2] * DeltaTime + L4_MABX_B.VelocityVectorRaw[j - 2]) + |
| 9216 | L4_MABX_B.JerkVectorRaw[j - 2] * 0.5 * (DeltaTime * DeltaTime); |
| 9217 | L4_MABX_B.PositionVectorRaw[j - 1] = ((L4_MABX_B.VelocityVectorRaw[j - 2] |
| 9218 | * DeltaTime + L4_MABX_B.PositionVectorRaw[j - 2]) + |
| 9219 | L4_MABX_B.AccelerationVectorRaw[j - 2] * 0.5 * (DeltaTime * DeltaTime)) |
| 9220 | + L4_MABX_B.JerkVectorRaw[j - 2] / 6.0 * rt_powd_snf(DeltaTime, 3.0); |
| 9221 | |
| 9222 | /* Transition: '<S359>:33' */ |
| 9223 | } |
| 9224 | |
| 9225 | /* Transition: '<S359>:37' */ |
| 9226 | DeltaTimeFinal *= 0.5; |
| 9227 | if ((L4_MABX_B.PositionVectorRaw[5] - PositionFinalLimited < 0.0) && |
| 9228 | (L4_MABX_B.VelocityVectorRaw[5] > 0.0)) { |
| 9229 | /* Transition: '<S359>:61' */ |
| 9230 | /* Transition: '<S359>:62' */ |
| 9231 | L4_MABX_DW.TimeFinal += DeltaTimeFinal; |
| 9232 | |
| 9233 | /* Transition: '<S359>:64' */ |
| 9234 | } else { |
| 9235 | /* Transition: '<S359>:63' */ |
| 9236 | L4_MABX_DW.TimeFinal -= DeltaTimeFinal; |
| 9237 | } |
| 9238 | |
| 9239 | /* Transition: '<S359>:60' */ |
| 9240 | Time56 = L4_MABX_DW.TimeFinal; |
| 9241 | if ((0.007 > Time56) || rtIsNaN(Time56)) { |
| 9242 | L4_MABX_DW.TimeFinal = 0.007; |
| 9243 | } else { |
| 9244 | L4_MABX_DW.TimeFinal = Time56; |
| 9245 | } |
| 9246 | |
| 9247 | /* Transition: '<S359>:17' */ |
| 9248 | } |
| 9249 | |
| 9250 | /* Transition: '<S359>:18' */ |
| 9251 | /* Transition: '<S359>:91' */ |
| 9252 | } else { |
| 9253 | /* Transition: '<S359>:90' */ |
| 9254 | } |
| 9255 | |
| 9256 | /* End of Chart: '<S344>/VehicleSpeedSetpointDynamicCalculation' */ |
| 9257 | |
| 9258 | /* Chart: '<S344>/TwentyPointVectorCalculation' */ |
| 9259 | if (L4_MABX_B.LogicalOperator1_ja) { |
| 9260 | /* Transition: '<S358>:89' */ |
| 9261 | /* Transition: '<S358>:39' */ |
| 9262 | L4_MABX_B.TimeVector[0] = L4_MABX_B.TimeVectorRaw[0]; |
| 9263 | L4_MABX_B.JerkVector[0] = L4_MABX_B.JerkVectorRaw[0]; |
| 9264 | L4_MABX_B.AccelerationVector[0] = L4_MABX_B.AccelerationVectorRaw[0]; |
| 9265 | L4_MABX_B.VelocityVector[0] = L4_MABX_B.VelocityVectorRaw[0]; |
| 9266 | L4_MABX_B.PositionVector[0] = L4_MABX_B.PositionVectorRaw[0]; |
| 9267 | PositionFinalLimited = (L4_MABX_B.TimeVectorRaw[1] - |
| 9268 | L4_MABX_B.TimeVectorRaw[0]) / 10.0; |
| 9269 | for (starting_index = 2U; starting_index < 11; starting_index++) { |
| 9270 | /* Transition: '<S358>:14' */ |
| 9271 | /* Transition: '<S358>:101' */ |
| 9272 | L4_MABX_B.TimeVector[starting_index - 1] = |
| 9273 | L4_MABX_B.TimeVector[starting_index - 2] + PositionFinalLimited; |
| 9274 | DeltaTime = L4_MABX_B.TimeVector[starting_index - 1] - |
| 9275 | L4_MABX_B.TimeVectorRaw[0]; |
| 9276 | L4_MABX_B.JerkVector[starting_index - 1] = L4_MABX_B.JerkVectorRaw[0]; |
| 9277 | L4_MABX_B.AccelerationVector[starting_index - 1] = |
| 9278 | L4_MABX_B.JerkVectorRaw[0] * DeltaTime + |
| 9279 | L4_MABX_B.AccelerationVectorRaw[0]; |
| 9280 | L4_MABX_B.VelocityVector[starting_index - 1] = |
| 9281 | (L4_MABX_B.AccelerationVectorRaw[0] * DeltaTime + |
| 9282 | L4_MABX_B.VelocityVectorRaw[0]) + 0.5 * L4_MABX_B.JerkVectorRaw[0] * |
| 9283 | (DeltaTime * DeltaTime); |
| 9284 | L4_MABX_B.PositionVector[starting_index - 1] = |
| 9285 | ((L4_MABX_B.VelocityVectorRaw[0] * DeltaTime + |
| 9286 | L4_MABX_B.PositionVectorRaw[0]) + 0.5 * |
| 9287 | L4_MABX_B.AccelerationVectorRaw[0] * (DeltaTime * DeltaTime)) + |
| 9288 | L4_MABX_B.JerkVectorRaw[0] / 6.0 * rt_powd_snf(DeltaTime, 3.0); |
| 9289 | DeltaTime = L4_MABX_B.PositionVector[starting_index - 2] + 0.0001; |
| 9290 | Time56 = L4_MABX_B.PositionVector[starting_index - 1]; |
| 9291 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9292 | Time56 = DeltaTime; |
| 9293 | } |
| 9294 | |
| 9295 | L4_MABX_B.PositionVector[starting_index - 1] = Time56; |
| 9296 | |
| 9297 | /* Transition: '<S358>:17' */ |
| 9298 | } |
| 9299 | |
| 9300 | /* Transition: '<S358>:110' */ |
| 9301 | L4_MABX_B.TimeVector[10] = L4_MABX_B.TimeVectorRaw[1]; |
| 9302 | L4_MABX_B.JerkVector[10] = L4_MABX_B.JerkVectorRaw[1]; |
| 9303 | L4_MABX_B.AccelerationVector[10] = L4_MABX_B.AccelerationVectorRaw[1]; |
| 9304 | L4_MABX_B.VelocityVector[10] = L4_MABX_B.VelocityVectorRaw[1]; |
| 9305 | DeltaTime = L4_MABX_B.PositionVector[9] + 0.0001; |
| 9306 | Time56 = L4_MABX_B.PositionVectorRaw[1]; |
| 9307 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9308 | Time56 = DeltaTime; |
| 9309 | } |
| 9310 | |
| 9311 | L4_MABX_B.PositionVector[10] = Time56; |
| 9312 | L4_MABX_B.TimeVector[11] = L4_MABX_B.TimeVectorRaw[2]; |
| 9313 | L4_MABX_B.JerkVector[11] = L4_MABX_B.JerkVectorRaw[2]; |
| 9314 | L4_MABX_B.AccelerationVector[11] = L4_MABX_B.AccelerationVectorRaw[2]; |
| 9315 | L4_MABX_B.VelocityVector[11] = L4_MABX_B.VelocityVectorRaw[2]; |
| 9316 | DeltaTime = L4_MABX_B.PositionVector[10] + 0.0001; |
| 9317 | Time56 = L4_MABX_B.PositionVectorRaw[2]; |
| 9318 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9319 | Time56 = DeltaTime; |
| 9320 | } |
| 9321 | |
| 9322 | L4_MABX_B.PositionVector[11] = Time56; |
| 9323 | PositionFinalLimited = (L4_MABX_B.TimeVectorRaw[3] - |
| 9324 | L4_MABX_B.TimeVectorRaw[2]) / 10.0; |
| 9325 | for (starting_index = 13U; starting_index < 22; starting_index++) { |
| 9326 | /* Transition: '<S358>:127' */ |
| 9327 | /* Transition: '<S358>:133' */ |
| 9328 | L4_MABX_B.TimeVector[starting_index - 1] = |
| 9329 | L4_MABX_B.TimeVector[starting_index - 2] + PositionFinalLimited; |
| 9330 | DeltaTime = L4_MABX_B.TimeVector[starting_index - 1] - |
| 9331 | L4_MABX_B.TimeVectorRaw[2]; |
| 9332 | L4_MABX_B.JerkVector[starting_index - 1] = L4_MABX_B.JerkVectorRaw[2]; |
| 9333 | L4_MABX_B.AccelerationVector[starting_index - 1] = |
| 9334 | L4_MABX_B.JerkVectorRaw[2] * DeltaTime + |
| 9335 | L4_MABX_B.AccelerationVectorRaw[2]; |
| 9336 | L4_MABX_B.VelocityVector[starting_index - 1] = |
| 9337 | (L4_MABX_B.AccelerationVectorRaw[2] * DeltaTime + |
| 9338 | L4_MABX_B.VelocityVectorRaw[2]) + 0.5 * L4_MABX_B.JerkVectorRaw[2] * |
| 9339 | (DeltaTime * DeltaTime); |
| 9340 | L4_MABX_B.PositionVector[starting_index - 1] = |
| 9341 | ((L4_MABX_B.VelocityVectorRaw[2] * DeltaTime + |
| 9342 | L4_MABX_B.PositionVectorRaw[2]) + 0.5 * |
| 9343 | L4_MABX_B.AccelerationVectorRaw[2] * (DeltaTime * DeltaTime)) + |
| 9344 | L4_MABX_B.JerkVectorRaw[2] / 6.0 * rt_powd_snf(DeltaTime, 3.0); |
| 9345 | DeltaTime = L4_MABX_B.PositionVector[starting_index - 2] + 0.0001; |
| 9346 | Time56 = L4_MABX_B.PositionVector[starting_index - 1]; |
| 9347 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9348 | Time56 = DeltaTime; |
| 9349 | } |
| 9350 | |
| 9351 | L4_MABX_B.PositionVector[starting_index - 1] = Time56; |
| 9352 | |
| 9353 | /* Transition: '<S358>:131' */ |
| 9354 | } |
| 9355 | |
| 9356 | /* Transition: '<S358>:132' */ |
| 9357 | L4_MABX_B.TimeVector[21] = L4_MABX_B.TimeVectorRaw[3]; |
| 9358 | L4_MABX_B.JerkVector[21] = L4_MABX_B.JerkVectorRaw[3]; |
| 9359 | L4_MABX_B.AccelerationVector[21] = L4_MABX_B.AccelerationVectorRaw[3]; |
| 9360 | L4_MABX_B.VelocityVector[21] = L4_MABX_B.VelocityVectorRaw[3]; |
| 9361 | DeltaTime = L4_MABX_B.PositionVector[20] + 0.0001; |
| 9362 | Time56 = L4_MABX_B.PositionVectorRaw[3]; |
| 9363 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9364 | Time56 = DeltaTime; |
| 9365 | } |
| 9366 | |
| 9367 | L4_MABX_B.PositionVector[21] = Time56; |
| 9368 | L4_MABX_B.TimeVector[22] = L4_MABX_B.TimeVectorRaw[4]; |
| 9369 | L4_MABX_B.JerkVector[22] = L4_MABX_B.JerkVectorRaw[4]; |
| 9370 | L4_MABX_B.AccelerationVector[22] = L4_MABX_B.AccelerationVectorRaw[4]; |
| 9371 | L4_MABX_B.VelocityVector[22] = L4_MABX_B.VelocityVectorRaw[4]; |
| 9372 | DeltaTime = L4_MABX_B.PositionVector[21] + 0.0001; |
| 9373 | Time56 = L4_MABX_B.PositionVectorRaw[4]; |
| 9374 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9375 | Time56 = DeltaTime; |
| 9376 | } |
| 9377 | |
| 9378 | L4_MABX_B.PositionVector[22] = Time56; |
| 9379 | PositionFinalLimited = (L4_MABX_B.TimeVectorRaw[5] - |
| 9380 | L4_MABX_B.TimeVectorRaw[4]) / 10.0; |
| 9381 | for (starting_index = 24U; starting_index < 33; starting_index++) { |
| 9382 | /* Transition: '<S358>:111' */ |
| 9383 | /* Transition: '<S358>:113' */ |
| 9384 | L4_MABX_B.TimeVector[starting_index - 1] = |
| 9385 | L4_MABX_B.TimeVector[starting_index - 2] + PositionFinalLimited; |
| 9386 | DeltaTime = L4_MABX_B.TimeVector[starting_index - 1] - |
| 9387 | L4_MABX_B.TimeVectorRaw[4]; |
| 9388 | L4_MABX_B.JerkVector[starting_index - 1] = L4_MABX_B.JerkVectorRaw[4]; |
| 9389 | L4_MABX_B.AccelerationVector[starting_index - 1] = |
| 9390 | L4_MABX_B.JerkVectorRaw[4] * DeltaTime + |
| 9391 | L4_MABX_B.AccelerationVectorRaw[4]; |
| 9392 | L4_MABX_B.VelocityVector[starting_index - 1] = |
| 9393 | (L4_MABX_B.AccelerationVectorRaw[4] * DeltaTime + |
| 9394 | L4_MABX_B.VelocityVectorRaw[4]) + 0.5 * L4_MABX_B.JerkVectorRaw[4] * |
| 9395 | (DeltaTime * DeltaTime); |
| 9396 | L4_MABX_B.PositionVector[starting_index - 1] = |
| 9397 | ((L4_MABX_B.VelocityVectorRaw[4] * DeltaTime + |
| 9398 | L4_MABX_B.PositionVectorRaw[4]) + 0.5 * |
| 9399 | L4_MABX_B.AccelerationVectorRaw[4] * (DeltaTime * DeltaTime)) + |
| 9400 | L4_MABX_B.JerkVectorRaw[4] / 6.0 * rt_powd_snf(DeltaTime, 3.0); |
| 9401 | DeltaTime = L4_MABX_B.PositionVector[starting_index - 2] + 0.0001; |
| 9402 | Time56 = L4_MABX_B.PositionVector[starting_index - 1]; |
| 9403 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9404 | Time56 = DeltaTime; |
| 9405 | } |
| 9406 | |
| 9407 | L4_MABX_B.PositionVector[starting_index - 1] = Time56; |
| 9408 | |
| 9409 | /* Transition: '<S358>:112' */ |
| 9410 | } |
| 9411 | |
| 9412 | /* Transition: '<S358>:114' */ |
| 9413 | L4_MABX_B.TimeVector[32] = L4_MABX_B.TimeVectorRaw[5]; |
| 9414 | L4_MABX_B.JerkVector[32] = L4_MABX_B.JerkVectorRaw[5]; |
| 9415 | L4_MABX_B.AccelerationVector[32] = L4_MABX_B.AccelerationVectorRaw[5]; |
| 9416 | L4_MABX_B.VelocityVector[32] = L4_MABX_B.VelocityVectorRaw[5]; |
| 9417 | DeltaTime = L4_MABX_B.PositionVector[31] + 0.0001; |
| 9418 | Time56 = L4_MABX_B.PositionVectorRaw[5]; |
| 9419 | if ((DeltaTime > Time56) || rtIsNaN(Time56)) { |
| 9420 | Time56 = DeltaTime; |
| 9421 | } |
| 9422 | |
| 9423 | L4_MABX_B.PositionVector[32] = Time56; |
| 9424 | |
| 9425 | /* Transition: '<S358>:141' */ |
| 9426 | } else { |
| 9427 | /* Transition: '<S358>:90' */ |
| 9428 | } |
| 9429 | |
| 9430 | /* End of Chart: '<S344>/TwentyPointVectorCalculation' */ |
| 9431 | |
| 9432 | /* Gain: '<S344>/Gain3' */ |
| 9433 | /* Transition: '<S359>:93' */ |
| 9434 | /* Gateway: L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/TwentyPointVectorCalculation */ |
| 9435 | /* During: L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/TwentyPointVectorCalculation */ |
| 9436 | /* Entry Internal: L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/TwentyPointVectorCalculation */ |
| 9437 | /* Transition: '<S358>:88' */ |
| 9438 | /* Transition: '<S358>:93' */ |
| 9439 | for (i = 0; i < 33; i++) { |
| 9440 | L4_MABX_B.Vehicle_speed_vector_kph[i] = L4_MABX_P.Gain3_Gain_l * |
| 9441 | L4_MABX_B.VelocityVector[i]; |
| 9442 | } |
| 9443 | |
| 9444 | /* End of Gain: '<S344>/Gain3' */ |
| 9445 | |
| 9446 | /* RelationalOperator: '<S361>/Compare' incorporates: |
| 9447 | * Constant: '<S361>/Constant' |
| 9448 | */ |
| 9449 | for (i = 0; i < 33; i++) { |
| 9450 | L4_MABX_B.Compare_n[i] = (L4_MABX_B.Vehicle_speed_vector_kph[i] < |
| 9451 | L4_MABX_P.Constant_Value_n); |
| 9452 | } |
| 9453 | |
| 9454 | /* End of RelationalOperator: '<S361>/Compare' */ |
| 9455 | |
| 9456 | /* Logic: '<S356>/Logical Operator' */ |
| 9457 | zcEvent = L4_MABX_B.Compare_n[0]; |
| 9458 | for (i = 0; i < 32; i++) { |
| 9459 | zcEvent = (zcEvent || L4_MABX_B.Compare_n[i + 1]); |
| 9460 | } |
| 9461 | |
| 9462 | L4_MABX_B.f_vspd_output_less_than_zero = zcEvent; |
| 9463 | |
| 9464 | /* End of Logic: '<S356>/Logical Operator' */ |
| 9465 | |
| 9466 | /* MinMax: '<S356>/MinMax3' */ |
| 9467 | PositionFinalLimited = L4_MABX_B.Vehicle_speed_vector_kph[0]; |
| 9468 | for (i = 0; i < 32; i++) { |
| 9469 | Time56 = L4_MABX_B.Vehicle_speed_vector_kph[i + 1]; |
| 9470 | if (!((PositionFinalLimited < Time56) || rtIsNaN(Time56))) { |
| 9471 | PositionFinalLimited = Time56; |
| 9472 | } |
| 9473 | } |
| 9474 | |
| 9475 | L4_MABX_B.MinMax3 = PositionFinalLimited; |
| 9476 | |
| 9477 | /* End of MinMax: '<S356>/MinMax3' */ |
| 9478 | |
| 9479 | /* UnitDelay: '<S360>/Unit_Delay' */ |
| 9480 | L4_MABX_B.Unit_Delay_f = L4_MABX_DW.Unit_Delay_DSTATE_bw; |
| 9481 | |
| 9482 | /* Outputs for Atomic SubSystem: '<S360>/If_Then_Else' */ |
| 9483 | L4_MABX_If_Then_Else_g(L4_MABX_B.LogicalOperator1_ja, L4_MABX_B.Saturation5, |
| 9484 | L4_MABX_B.Unit_Delay_f, &L4_MABX_B.If_Then_Else_og); |
| 9485 | |
| 9486 | /* End of Outputs for SubSystem: '<S360>/If_Then_Else' */ |
| 9487 | |
| 9488 | /* MinMax: '<S356>/MinMax5' */ |
| 9489 | DeltaTime = L4_MABX_B.If_Then_Else_og.Switch; |
| 9490 | PositionFinalLimited = L4_MABX_B.VSPD_TARGET_KPH_APV_gu; |
| 9491 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 9492 | PositionFinalLimited = DeltaTime; |
| 9493 | } |
| 9494 | |
| 9495 | L4_MABX_B.MinMax5 = PositionFinalLimited; |
| 9496 | |
| 9497 | /* End of MinMax: '<S356>/MinMax5' */ |
| 9498 | |
| 9499 | /* Sum: '<S356>/Subtract' */ |
| 9500 | L4_MABX_B.Subtract_al = L4_MABX_B.MinMax3 - L4_MABX_B.MinMax5; |
| 9501 | |
| 9502 | /* Abs: '<S356>/Abs' */ |
| 9503 | L4_MABX_B.Abs_m = fabs(L4_MABX_B.Subtract_al); |
| 9504 | |
| 9505 | /* RelationalOperator: '<S356>/Relational Operator' incorporates: |
| 9506 | * Constant: '<S356>/MIN_VSPD_DELTA_THRESHOLD_KPH_APV' |
| 9507 | */ |
| 9508 | L4_MABX_B.RelationalOperator_f = (L4_MABX_B.Abs_m > |
| 9509 | L4_MABX_P.MIN_VSPD_DELTA_THRESHOLD_KPH_AP); |
| 9510 | |
| 9511 | /* Logic: '<S362>/Logical Operator3' incorporates: |
| 9512 | * Constant: '<S356>/CPV' |
| 9513 | */ |
| 9514 | L4_MABX_B.LogicalOperator3_o = !L4_MABX_P.CPV_Value_a; |
| 9515 | |
| 9516 | /* UnitDelay: '<S362>/Unit_Delay' */ |
| 9517 | L4_MABX_B.Unit_Delay_ag = L4_MABX_DW.Unit_Delay_DSTATE_ko; |
| 9518 | |
| 9519 | /* Logic: '<S362>/Logical Operator' */ |
| 9520 | L4_MABX_B.LogicalOperator_o = (L4_MABX_B.LogicalOperator3_o && |
| 9521 | L4_MABX_B.Unit_Delay_ag); |
| 9522 | |
| 9523 | /* Logic: '<S362>/Logical Operator1' */ |
| 9524 | L4_MABX_B.LogicalOperator1_ph = (L4_MABX_B.LogicalOperator1_ja || |
| 9525 | L4_MABX_B.LogicalOperator_o); |
| 9526 | |
| 9527 | /* Logic: '<S356>/Logical Operator2' */ |
| 9528 | L4_MABX_B.f_vspd_min_delta_greater_than_t = (L4_MABX_B.RelationalOperator_f && |
| 9529 | L4_MABX_B.LogicalOperator1_ph); |
| 9530 | |
| 9531 | /* MinMax: '<S356>/MinMax4' */ |
| 9532 | PositionFinalLimited = L4_MABX_B.Vehicle_speed_vector_kph[0]; |
| 9533 | for (i = 0; i < 32; i++) { |
| 9534 | Time56 = L4_MABX_B.Vehicle_speed_vector_kph[i + 1]; |
| 9535 | if (!((PositionFinalLimited > Time56) || rtIsNaN(Time56))) { |
| 9536 | PositionFinalLimited = Time56; |
| 9537 | } |
| 9538 | } |
| 9539 | |
| 9540 | L4_MABX_B.MinMax4 = PositionFinalLimited; |
| 9541 | |
| 9542 | /* End of MinMax: '<S356>/MinMax4' */ |
| 9543 | |
| 9544 | /* MinMax: '<S356>/MinMax6' */ |
| 9545 | DeltaTime = L4_MABX_B.If_Then_Else_og.Switch; |
| 9546 | PositionFinalLimited = L4_MABX_B.VSPD_TARGET_KPH_APV_gu; |
| 9547 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 9548 | PositionFinalLimited = DeltaTime; |
| 9549 | } |
| 9550 | |
| 9551 | L4_MABX_B.MinMax6_j = PositionFinalLimited; |
| 9552 | |
| 9553 | /* End of MinMax: '<S356>/MinMax6' */ |
| 9554 | |
| 9555 | /* Sum: '<S356>/Subtract1' */ |
| 9556 | L4_MABX_B.Subtract1_ca = L4_MABX_B.MinMax4 - L4_MABX_B.MinMax6_j; |
| 9557 | |
| 9558 | /* Abs: '<S356>/Abs1' */ |
| 9559 | L4_MABX_B.Abs1_h5 = fabs(L4_MABX_B.Subtract1_ca); |
| 9560 | |
| 9561 | /* RelationalOperator: '<S356>/Relational Operator1' incorporates: |
| 9562 | * Constant: '<S356>/MAX_VSPD_DELTA_THRESHOLD_KPH_APV' |
| 9563 | */ |
| 9564 | L4_MABX_B.RelationalOperator1_g = (L4_MABX_B.Abs1_h5 > |
| 9565 | L4_MABX_P.MAX_VSPD_DELTA_THRESHOLD_KPH_AP); |
| 9566 | |
| 9567 | /* Logic: '<S356>/Logical Operator1' */ |
| 9568 | L4_MABX_B.f_vspd_max_delta_greater_than_t = (L4_MABX_B.RelationalOperator1_g && |
| 9569 | L4_MABX_B.LogicalOperator1_ph); |
| 9570 | |
| 9571 | /* MinMax: '<S356>/MinMax8' */ |
| 9572 | PositionFinalLimited = L4_MABX_B.AccelerationVector[0]; |
| 9573 | for (i = 0; i < 32; i++) { |
| 9574 | Time56 = L4_MABX_B.AccelerationVector[i + 1]; |
| 9575 | if (!((PositionFinalLimited > Time56) || rtIsNaN(Time56))) { |
| 9576 | PositionFinalLimited = Time56; |
| 9577 | } |
| 9578 | } |
| 9579 | |
| 9580 | L4_MABX_B.MinMax8 = PositionFinalLimited; |
| 9581 | |
| 9582 | /* End of MinMax: '<S356>/MinMax8' */ |
| 9583 | |
| 9584 | /* RelationalOperator: '<S356>/Relational Operator2' incorporates: |
| 9585 | * Constant: '<S356>/ACCEL_RATE_ABS_MAX_THRESHOLD_MS2_APV' |
| 9586 | */ |
| 9587 | L4_MABX_B.f_accel_rate_greater_than_thres = (L4_MABX_B.MinMax8 > |
| 9588 | L4_MABX_P.ACCEL_RATE_ABS_MAX_THRESHOLD_MS); |
| 9589 | |
| 9590 | /* MinMax: '<S356>/MinMax7' */ |
| 9591 | PositionFinalLimited = L4_MABX_B.AccelerationVector[0]; |
| 9592 | for (i = 0; i < 32; i++) { |
| 9593 | Time56 = L4_MABX_B.AccelerationVector[i + 1]; |
| 9594 | if (!((PositionFinalLimited < Time56) || rtIsNaN(Time56))) { |
| 9595 | PositionFinalLimited = Time56; |
| 9596 | } |
| 9597 | } |
| 9598 | |
| 9599 | L4_MABX_B.MinMax7 = PositionFinalLimited; |
| 9600 | |
| 9601 | /* End of MinMax: '<S356>/MinMax7' */ |
| 9602 | |
| 9603 | /* RelationalOperator: '<S356>/Relational Operator3' incorporates: |
| 9604 | * Constant: '<S356>/ACCEL_RATE_ABS_MIN_THRESHOLD_MS2_APV' |
| 9605 | */ |
| 9606 | L4_MABX_B.f_decel_rate_greater_than_thres = (L4_MABX_B.MinMax7 < |
| 9607 | L4_MABX_P.ACCEL_RATE_ABS_MIN_THRESHOLD_MS); |
| 9608 | |
| 9609 | /* MinMax: '<S356>/MinMax10' */ |
| 9610 | PositionFinalLimited = L4_MABX_B.JerkVector[0]; |
| 9611 | for (i = 0; i < 32; i++) { |
| 9612 | Time56 = L4_MABX_B.JerkVector[i + 1]; |
| 9613 | if (!((PositionFinalLimited > Time56) || rtIsNaN(Time56))) { |
| 9614 | PositionFinalLimited = Time56; |
| 9615 | } |
| 9616 | } |
| 9617 | |
| 9618 | L4_MABX_B.MinMax10 = PositionFinalLimited; |
| 9619 | |
| 9620 | /* End of MinMax: '<S356>/MinMax10' */ |
| 9621 | |
| 9622 | /* RelationalOperator: '<S356>/Relational Operator4' incorporates: |
| 9623 | * Constant: '<S356>/JERK_RATE_ABS_MAX_THRESHOLD_MS3_APV' |
| 9624 | */ |
| 9625 | L4_MABX_B.f_jerk_rate_greater_than_thresh = (L4_MABX_B.MinMax10 > |
| 9626 | L4_MABX_P.JERK_RATE_ABS_MAX_THRESHOLD_MS3); |
| 9627 | |
| 9628 | /* MinMax: '<S356>/MinMax9' */ |
| 9629 | PositionFinalLimited = L4_MABX_B.JerkVector[0]; |
| 9630 | for (i = 0; i < 32; i++) { |
| 9631 | Time56 = L4_MABX_B.JerkVector[i + 1]; |
| 9632 | if (!((PositionFinalLimited < Time56) || rtIsNaN(Time56))) { |
| 9633 | PositionFinalLimited = Time56; |
| 9634 | } |
| 9635 | } |
| 9636 | |
| 9637 | L4_MABX_B.MinMax9 = PositionFinalLimited; |
| 9638 | |
| 9639 | /* End of MinMax: '<S356>/MinMax9' */ |
| 9640 | |
| 9641 | /* RelationalOperator: '<S356>/Relational Operator5' incorporates: |
| 9642 | * Constant: '<S356>/JERK_RATE_ABS_MIN_THRESHOLD_MS3_APV' |
| 9643 | */ |
| 9644 | L4_MABX_B.f_jerk_rate_greater_than_thre_n = (L4_MABX_B.MinMax9 < |
| 9645 | L4_MABX_P.JERK_RATE_ABS_MIN_THRESHOLD_MS3); |
| 9646 | |
| 9647 | /* Sum: '<S356>/Subtract2' */ |
| 9648 | L4_MABX_B.Subtract2 = L4_MABX_B.Distance_to_achieve_speed_targe - |
| 9649 | L4_MABX_B.PositionVector[32]; |
| 9650 | |
| 9651 | /* Abs: '<S356>/Abs2' */ |
| 9652 | L4_MABX_B.Abs2 = fabs(L4_MABX_B.Subtract2); |
| 9653 | |
| 9654 | /* RelationalOperator: '<S356>/Relational Operator6' incorporates: |
| 9655 | * Constant: '<S356>/MAX_DISTANCE_DELTA_THRESHOLD_M_APV' |
| 9656 | */ |
| 9657 | L4_MABX_B.RelationalOperator6_i = (L4_MABX_B.Abs2 > |
| 9658 | L4_MABX_P.MAX_DISTANCE_DELTA_THRESHOLD_M_); |
| 9659 | |
| 9660 | /* Logic: '<S356>/Logical Operator3' */ |
| 9661 | L4_MABX_B.f_distance_max_delta_greater_th = (L4_MABX_B.RelationalOperator6_i && |
| 9662 | L4_MABX_B.LogicalOperator1_ph); |
| 9663 | |
| 9664 | /* Logic: '<S356>/Logical Operator4' */ |
| 9665 | L4_MABX_B.F_Inhibit_sigmoid_vector_shapin = |
| 9666 | (L4_MABX_B.f_vspd_output_less_than_zero || |
| 9667 | L4_MABX_B.f_vspd_min_delta_greater_than_t || |
| 9668 | L4_MABX_B.f_vspd_max_delta_greater_than_t || |
| 9669 | L4_MABX_B.f_accel_rate_greater_than_thres || |
| 9670 | L4_MABX_B.f_decel_rate_greater_than_thres || |
| 9671 | L4_MABX_B.f_jerk_rate_greater_than_thresh || |
| 9672 | L4_MABX_B.f_jerk_rate_greater_than_thre_n || |
| 9673 | L4_MABX_B.f_distance_max_delta_greater_th); |
| 9674 | |
| 9675 | /* Logic: '<S81>/Logical Operator' */ |
| 9676 | L4_MABX_B.LogicalOperator_nd = !L4_MABX_B.F_Inhibit_sigmoid_vector_shapin; |
| 9677 | |
| 9678 | /* Logic: '<S81>/Logical Operator2' */ |
| 9679 | L4_MABX_B.LogicalOperator2_ft = (L4_MABX_B.Compare_jr && |
| 9680 | L4_MABX_B.LogicalOperator_nd); |
| 9681 | |
| 9682 | /* RelationalOperator: '<S357>/Relational Operator3' incorporates: |
| 9683 | * Constant: '<S357>/CPV1' |
| 9684 | */ |
| 9685 | L4_MABX_B.RelationalOperator3_k = (L4_MABX_B.Saturation5 < |
| 9686 | L4_MABX_P.CPV1_Value_i); |
| 9687 | |
| 9688 | /* RelationalOperator: '<S357>/Relational Operator1' incorporates: |
| 9689 | * Constant: '<S344>/MIN_VSPD_SIGMOID_INITIAL_KPH_APV' |
| 9690 | */ |
| 9691 | L4_MABX_B.RelationalOperator1_h = (L4_MABX_B.If_Then_Else_og.Switch < |
| 9692 | L4_MABX_P.MIN_VSPD_SIGMOID_INITIAL_KPH_AP); |
| 9693 | |
| 9694 | /* Logic: '<S357>/Logical Operator' */ |
| 9695 | L4_MABX_B.LogicalOperator_da = (L4_MABX_B.RelationalOperator3_k || |
| 9696 | L4_MABX_B.RelationalOperator1_h); |
| 9697 | |
| 9698 | /* RelationalOperator: '<S357>/Relational Operator2' incorporates: |
| 9699 | * Constant: '<S344>/MIN_VSPD_SIGMOID_FINAL_KPH_APV' |
| 9700 | */ |
| 9701 | L4_MABX_B.RelationalOperator2_g = (L4_MABX_B.VSPD_TARGET_KPH_APV_gu < |
| 9702 | L4_MABX_P.MIN_VSPD_SIGMOID_FINAL_KPH_APV_); |
| 9703 | |
| 9704 | /* Logic: '<S357>/Logical Operator2' */ |
| 9705 | L4_MABX_B.F_set_max_distance_accumulated = (L4_MABX_B.LogicalOperator_da && |
| 9706 | L4_MABX_B.RelationalOperator2_g); |
| 9707 | |
| 9708 | /* UnitDelay: '<S371>/FixPt Unit Delay2' */ |
| 9709 | L4_MABX_B.FixPtUnitDelay2_o = L4_MABX_DW.FixPtUnitDelay2_DSTATE_f; |
| 9710 | |
| 9711 | /* Logic: '<S371>/FixPt Logical Operator' */ |
| 9712 | L4_MABX_B.FixPtLogicalOperator = (uint8_T)(L4_MABX_B.LogicalOperator1_ja || |
| 9713 | (L4_MABX_B.FixPtUnitDelay2_o != 0)); |
| 9714 | |
| 9715 | /* UnitDelay: '<S371>/FixPt Unit Delay1' */ |
| 9716 | L4_MABX_B.Xold_p = L4_MABX_DW.FixPtUnitDelay1_DSTATE_l; |
| 9717 | |
| 9718 | /* Switch: '<S371>/Init' incorporates: |
| 9719 | * Constant: '<S366>/CPV' |
| 9720 | */ |
| 9721 | if (L4_MABX_B.FixPtLogicalOperator != 0) { |
| 9722 | L4_MABX_B.Init_h = L4_MABX_P.CPV_Value_h; |
| 9723 | } else { |
| 9724 | L4_MABX_B.Init_h = L4_MABX_B.Xold_p; |
| 9725 | } |
| 9726 | |
| 9727 | /* End of Switch: '<S371>/Init' */ |
| 9728 | |
| 9729 | /* Gain: '<S357>/Gain1' */ |
| 9730 | L4_MABX_B.Gain1_c = L4_MABX_P.Gain1_Gain_k * L4_MABX_B.Saturation5; |
| 9731 | |
| 9732 | /* DigitalClock: '<S369>/Digital Clock' */ |
| 9733 | L4_MABX_B.DigitalClock_f = L4_MABX_M->Timing.t[0]; |
| 9734 | |
| 9735 | /* UnitDelay: '<S369>/Unit_Delay' */ |
| 9736 | L4_MABX_B.Unit_Delay_e = L4_MABX_DW.Unit_Delay_DSTATE_p; |
| 9737 | |
| 9738 | /* Sum: '<S369>/Subtract' */ |
| 9739 | L4_MABX_B.Subtract_b = L4_MABX_B.DigitalClock_f - L4_MABX_B.Unit_Delay_e; |
| 9740 | |
| 9741 | /* Product: '<S366>/Product1' incorporates: |
| 9742 | * Constant: '<S365>/CPV1' |
| 9743 | */ |
| 9744 | L4_MABX_B.Product1_a = L4_MABX_P.CPV1_Value_e * L4_MABX_B.Gain1_c * |
| 9745 | L4_MABX_B.Subtract_b; |
| 9746 | |
| 9747 | /* Sum: '<S366>/Add' */ |
| 9748 | L4_MABX_B.Add_h = L4_MABX_B.Init_h + L4_MABX_B.Product1_a; |
| 9749 | |
| 9750 | /* MinMax: '<S366>/MinMax' */ |
| 9751 | DeltaTime = L4_MABX_B.Distance_to_achieve_speed_targe; |
| 9752 | PositionFinalLimited = L4_MABX_B.Add_h; |
| 9753 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 9754 | PositionFinalLimited = DeltaTime; |
| 9755 | } |
| 9756 | |
| 9757 | L4_MABX_B.MinMax_a = PositionFinalLimited; |
| 9758 | |
| 9759 | /* End of MinMax: '<S366>/MinMax' */ |
| 9760 | |
| 9761 | /* Outputs for Atomic SubSystem: '<S366>/If_Then_Else' */ |
| 9762 | L4_MABX_If_Then_Else_g(L4_MABX_B.F_set_max_distance_accumulated, |
| 9763 | L4_MABX_B.Distance_to_achieve_speed_targe, L4_MABX_B.MinMax_a, |
| 9764 | &L4_MABX_B.If_Then_Else_gf); |
| 9765 | |
| 9766 | /* End of Outputs for SubSystem: '<S366>/If_Then_Else' */ |
| 9767 | |
| 9768 | /* RelationalOperator: '<S357>/Relational Operator' */ |
| 9769 | L4_MABX_B.RelationalOperator_lj = (L4_MABX_B.If_Then_Else_gf.Switch == |
| 9770 | L4_MABX_B.Distance_to_achieve_speed_targe); |
| 9771 | |
| 9772 | /* S-Function (sfix_look1_dyn): '<S357>/Lookup Table Dynamic' */ |
| 9773 | /* Dynamic Look-Up Table Block: '<S357>/Lookup Table Dynamic' |
| 9774 | * Input0 Data Type: Floating Point real_T |
| 9775 | * Input1 Data Type: Floating Point real_T |
| 9776 | * Input2 Data Type: Floating Point real_T |
| 9777 | * Output0 Data Type: Floating Point real_T |
| 9778 | * Lookup Method: Linear_Endpoint |
| 9779 | * |
| 9780 | */ |
| 9781 | LookUp_real_T_real_T( &(L4_MABX_B.LookupTableDynamic), |
| 9782 | &L4_MABX_B.Vehicle_speed_vector_kph[0], |
| 9783 | L4_MABX_B.If_Then_Else_gf.Switch, |
| 9784 | &L4_MABX_B.PositionVector[0], 32U); |
| 9785 | |
| 9786 | /* Outputs for Atomic SubSystem: '<S357>/If_Then_Else' */ |
| 9787 | L4_MABX_If_Then_Else_g(L4_MABX_B.RelationalOperator_lj, |
| 9788 | L4_MABX_B.VSPD_TARGET_KPH_APV_gu, L4_MABX_B.LookupTableDynamic, |
| 9789 | &L4_MABX_B.If_Then_Else_jh); |
| 9790 | |
| 9791 | /* End of Outputs for SubSystem: '<S357>/If_Then_Else' */ |
| 9792 | |
| 9793 | /* UnitDelay: '<S349>/Delay Input1' */ |
| 9794 | L4_MABX_B.Uk1_k[0] = L4_MABX_DW.DelayInput1_DSTATE_f[0]; |
| 9795 | L4_MABX_B.Uk1_k[1] = L4_MABX_DW.DelayInput1_DSTATE_f[1]; |
| 9796 | |
| 9797 | /* RelationalOperator: '<S349>/FixPt Relational Operator' */ |
| 9798 | L4_MABX_B.FixPtRelationalOperator_p[0] = |
| 9799 | (L4_MABX_B.Distance_to_achieve_speed_targe != L4_MABX_B.Uk1_k[0]); |
| 9800 | L4_MABX_B.FixPtRelationalOperator_p[1] = (L4_MABX_B.Vehicle_speed_target_o != |
| 9801 | L4_MABX_B.Uk1_k[1]); |
| 9802 | |
| 9803 | /* Logic: '<S343>/Logical Operator' */ |
| 9804 | L4_MABX_B.LogicalOperator_gb = (L4_MABX_B.FixPtRelationalOperator_p[0] || |
| 9805 | L4_MABX_B.FixPtRelationalOperator_p[1]); |
| 9806 | |
| 9807 | /* UnitDelay: '<S351>/Unit_Delay' */ |
| 9808 | L4_MABX_B.Unit_Delay_ls = L4_MABX_DW.Unit_Delay_DSTATE_la; |
| 9809 | |
| 9810 | /* Logic: '<S351>/Logical Operator1' */ |
| 9811 | L4_MABX_B.LogicalOperator1_lp = (L4_MABX_B.LogicalOperator_gb || |
| 9812 | L4_MABX_B.Unit_Delay_ls); |
| 9813 | |
| 9814 | /* UnitDelay: '<S355>/FixPt Unit Delay2' */ |
| 9815 | L4_MABX_B.FixPtUnitDelay2_n = L4_MABX_DW.FixPtUnitDelay2_DSTATE_c; |
| 9816 | |
| 9817 | /* UnitDelay: '<S355>/FixPt Unit Delay1' */ |
| 9818 | L4_MABX_B.Xold_o = L4_MABX_DW.FixPtUnitDelay1_DSTATE_e; |
| 9819 | |
| 9820 | /* Switch: '<S355>/Init' */ |
| 9821 | if (L4_MABX_B.FixPtUnitDelay2_n != 0) { |
| 9822 | L4_MABX_B.Init_p = L4_MABX_B.Vehicle_speed_target_o; |
| 9823 | } else { |
| 9824 | L4_MABX_B.Init_p = L4_MABX_B.Xold_o; |
| 9825 | } |
| 9826 | |
| 9827 | /* End of Switch: '<S355>/Init' */ |
| 9828 | |
| 9829 | /* UnitDelay: '<S350>/Unit_Delay' */ |
| 9830 | L4_MABX_B.Vehicle_speed_target_c = L4_MABX_DW.Unit_Delay_1_DSTATE_j; |
| 9831 | L4_MABX_B.Vehicle_speed = L4_MABX_DW.Unit_Delay_2_DSTATE_e; |
| 9832 | L4_MABX_B.Distance_m = L4_MABX_DW.Unit_Delay_3_DSTATE_j; |
| 9833 | |
| 9834 | /* Outputs for Atomic SubSystem: '<S350>/If_Then_Else' */ |
| 9835 | L4_MABX_If_Then_Else_m(L4_MABX_B.LogicalOperator_gb, |
| 9836 | L4_MABX_B.Vehicle_speed_target_o, L4_MABX_B.SFunction1_o1_ee, |
| 9837 | L4_MABX_B.Distance_to_achieve_speed_targe, L4_MABX_B.Vehicle_speed_target_c, |
| 9838 | L4_MABX_B.Vehicle_speed, L4_MABX_B.Distance_m, &L4_MABX_B.If_Then_Else_mm); |
| 9839 | |
| 9840 | /* End of Outputs for SubSystem: '<S350>/If_Then_Else' */ |
| 9841 | |
| 9842 | /* Sum: '<S350>/Subtract' */ |
| 9843 | L4_MABX_B.err = L4_MABX_B.If_Then_Else_mm.Vehicle_speed - |
| 9844 | L4_MABX_B.If_Then_Else_mm.Vehicle_speed_target; |
| 9845 | |
| 9846 | /* Abs: '<S350>/Abs2' */ |
| 9847 | L4_MABX_B.err_abs = fabs(L4_MABX_B.err); |
| 9848 | |
| 9849 | /* Gain: '<S350>/Gain2' */ |
| 9850 | L4_MABX_B.Gain2_k = L4_MABX_P.Gain2_Gain_l * |
| 9851 | L4_MABX_B.If_Then_Else_mm.Vehicle_speed; |
| 9852 | |
| 9853 | /* Saturate: '<S350>/Saturation4' */ |
| 9854 | DeltaTime = L4_MABX_B.Gain2_k; |
| 9855 | Time56 = L4_MABX_P.Saturation4_LowerSat_e; |
| 9856 | PositionFinalLimited = L4_MABX_P.Saturation4_UpperSat_a; |
| 9857 | if (DeltaTime > PositionFinalLimited) { |
| 9858 | L4_MABX_B.Saturation4 = PositionFinalLimited; |
| 9859 | } else if (DeltaTime < Time56) { |
| 9860 | L4_MABX_B.Saturation4 = Time56; |
| 9861 | } else { |
| 9862 | L4_MABX_B.Saturation4 = DeltaTime; |
| 9863 | } |
| 9864 | |
| 9865 | /* End of Saturate: '<S350>/Saturation4' */ |
| 9866 | |
| 9867 | /* Product: '<S350>/Divide2' */ |
| 9868 | L4_MABX_B.time_to_target_vspd_secs = L4_MABX_B.If_Then_Else_mm.Distance_m / |
| 9869 | L4_MABX_B.Saturation4; |
| 9870 | |
| 9871 | /* DigitalClock: '<S348>/Digital Clock' */ |
| 9872 | L4_MABX_B.DigitalClock_p = L4_MABX_M->Timing.t[0]; |
| 9873 | |
| 9874 | /* UnitDelay: '<S348>/Unit_Delay' */ |
| 9875 | L4_MABX_B.Unit_Delay_bb = L4_MABX_DW.Unit_Delay_DSTATE_ff; |
| 9876 | |
| 9877 | /* Sum: '<S348>/Subtract' */ |
| 9878 | L4_MABX_B.Subtract_g = L4_MABX_B.DigitalClock_p - L4_MABX_B.Unit_Delay_bb; |
| 9879 | |
| 9880 | /* MinMax: '<S350>/MinMax3' */ |
| 9881 | DeltaTime = L4_MABX_B.time_to_target_vspd_secs; |
| 9882 | PositionFinalLimited = L4_MABX_B.Subtract_g; |
| 9883 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 9884 | PositionFinalLimited = DeltaTime; |
| 9885 | } |
| 9886 | |
| 9887 | L4_MABX_B.MinMax3_n = PositionFinalLimited; |
| 9888 | |
| 9889 | /* End of MinMax: '<S350>/MinMax3' */ |
| 9890 | |
| 9891 | /* Saturate: '<S350>/Saturation1' */ |
| 9892 | DeltaTime = L4_MABX_B.MinMax3_n; |
| 9893 | Time56 = L4_MABX_P.Saturation1_LowerSat_o; |
| 9894 | PositionFinalLimited = L4_MABX_P.Saturation1_UpperSat_j; |
| 9895 | if (DeltaTime > PositionFinalLimited) { |
| 9896 | L4_MABX_B.Saturation1_e = PositionFinalLimited; |
| 9897 | } else if (DeltaTime < Time56) { |
| 9898 | L4_MABX_B.Saturation1_e = Time56; |
| 9899 | } else { |
| 9900 | L4_MABX_B.Saturation1_e = DeltaTime; |
| 9901 | } |
| 9902 | |
| 9903 | /* End of Saturate: '<S350>/Saturation1' */ |
| 9904 | |
| 9905 | /* Product: '<S350>/Divide' */ |
| 9906 | L4_MABX_B.Divide_e = L4_MABX_B.err_abs / L4_MABX_B.Saturation1_e; |
| 9907 | |
| 9908 | /* Abs: '<S351>/Abs' */ |
| 9909 | L4_MABX_B.Abs_ma = fabs(L4_MABX_B.Divide_e); |
| 9910 | |
| 9911 | /* Product: '<S351>/Product1' */ |
| 9912 | L4_MABX_B.Product1_iv = L4_MABX_B.Abs_ma * L4_MABX_B.Subtract_g; |
| 9913 | |
| 9914 | /* Sum: '<S351>/Add1' */ |
| 9915 | L4_MABX_B.Add1_bf = L4_MABX_B.Init_p + L4_MABX_B.Product1_iv; |
| 9916 | |
| 9917 | /* MinMax: '<S351>/MinMax2' */ |
| 9918 | DeltaTime = L4_MABX_B.Vehicle_speed_target_o; |
| 9919 | PositionFinalLimited = L4_MABX_B.Add1_bf; |
| 9920 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 9921 | PositionFinalLimited = DeltaTime; |
| 9922 | } |
| 9923 | |
| 9924 | L4_MABX_B.MinMax2_c = PositionFinalLimited; |
| 9925 | |
| 9926 | /* End of MinMax: '<S351>/MinMax2' */ |
| 9927 | |
| 9928 | /* Abs: '<S351>/Abs1' */ |
| 9929 | L4_MABX_B.Abs1_f = fabs(L4_MABX_B.Divide_e); |
| 9930 | |
| 9931 | /* Product: '<S351>/Product2' */ |
| 9932 | L4_MABX_B.Product2_m = L4_MABX_B.Subtract_g * L4_MABX_B.Abs1_f; |
| 9933 | |
| 9934 | /* Sum: '<S351>/Subtract1' */ |
| 9935 | L4_MABX_B.Subtract1_h2 = L4_MABX_B.Init_p - L4_MABX_B.Product2_m; |
| 9936 | |
| 9937 | /* MinMax: '<S351>/MinMax1' */ |
| 9938 | DeltaTime = L4_MABX_B.MinMax2_c; |
| 9939 | PositionFinalLimited = L4_MABX_B.Subtract1_h2; |
| 9940 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 9941 | PositionFinalLimited = DeltaTime; |
| 9942 | } |
| 9943 | |
| 9944 | L4_MABX_B.MinMax1_p = PositionFinalLimited; |
| 9945 | |
| 9946 | /* End of MinMax: '<S351>/MinMax1' */ |
| 9947 | |
| 9948 | /* Outputs for Atomic SubSystem: '<S351>/If_Then_Else' */ |
| 9949 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_lp, L4_MABX_B.SFunction1_o1_ee, |
| 9950 | L4_MABX_B.MinMax1_p, &L4_MABX_B.If_Then_Else_pz); |
| 9951 | |
| 9952 | /* End of Outputs for SubSystem: '<S351>/If_Then_Else' */ |
| 9953 | |
| 9954 | /* Outputs for Atomic SubSystem: '<S81>/If_Then_Else' */ |
| 9955 | L4_MABX_If_Then_Else_g(L4_MABX_B.LogicalOperator2_ft, |
| 9956 | L4_MABX_B.If_Then_Else_jh.Switch, L4_MABX_B.If_Then_Else_pz.Switch, |
| 9957 | &L4_MABX_B.If_Then_Else_ji); |
| 9958 | |
| 9959 | /* End of Outputs for SubSystem: '<S81>/If_Then_Else' */ |
| 9960 | |
| 9961 | /* MinMax: '<S81>/MinMax' */ |
| 9962 | DeltaTime = L4_MABX_B.If_Then_Else_m4.Switch; |
| 9963 | PositionFinalLimited = L4_MABX_B.If_Then_Else_bf.Switch; |
| 9964 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 9965 | PositionFinalLimited = DeltaTime; |
| 9966 | } |
| 9967 | |
| 9968 | Time56 = L4_MABX_B.Vehicle_speed_abs_max; |
| 9969 | if (!((PositionFinalLimited < Time56) || rtIsNaN(Time56))) { |
| 9970 | PositionFinalLimited = Time56; |
| 9971 | } |
| 9972 | |
| 9973 | Time56 = L4_MABX_B.If_Then_Else_ji.Switch; |
| 9974 | if (!((PositionFinalLimited < Time56) || rtIsNaN(Time56))) { |
| 9975 | PositionFinalLimited = Time56; |
| 9976 | } |
| 9977 | |
| 9978 | L4_MABX_B.MinMax_o = PositionFinalLimited; |
| 9979 | |
| 9980 | /* End of MinMax: '<S81>/MinMax' */ |
| 9981 | |
| 9982 | /* Saturate: '<S81>/Saturation8' */ |
| 9983 | DeltaTime = L4_MABX_B.MinMax_o; |
| 9984 | Time56 = L4_MABX_P.Saturation8_LowerSat; |
| 9985 | PositionFinalLimited = L4_MABX_P.Saturation8_UpperSat; |
| 9986 | if (DeltaTime > PositionFinalLimited) { |
| 9987 | L4_MABX_B.Vehicle_speed_target_n = PositionFinalLimited; |
| 9988 | } else if (DeltaTime < Time56) { |
| 9989 | L4_MABX_B.Vehicle_speed_target_n = Time56; |
| 9990 | } else { |
| 9991 | L4_MABX_B.Vehicle_speed_target_n = DeltaTime; |
| 9992 | } |
| 9993 | |
| 9994 | /* End of Saturate: '<S81>/Saturation8' */ |
| 9995 | |
| 9996 | /* Lookup_n-D: '<S200>/2D_Lookup_Table' */ |
| 9997 | L4_MABX_B.uD_Lookup_Table_l = look2_binlcapw(0.0, |
| 9998 | L4_MABX_B.SPN1760_GrossCombinationVehicle, BRK_GOV_FF_DECEL_RATE_STEP_MPV, |
| 9999 | BRK_GOV_FF_MASS_STEP_MPV, BRK_GOV_FF_PRESS_KPA_DATA_MPV, |
| 10000 | L4_MABX_P.uD_Lookup_Table_maxIndex_e, 16U); |
| 10001 | |
| 10002 | /* Product: '<S106>/Divide' */ |
| 10003 | L4_MABX_B.Divide_f = L4_MABX_B.uD_Lookup_Table_l / |
| 10004 | L4_MABX_B.Primary_brake_circuit_pressur_n; |
| 10005 | |
| 10006 | /* Gain: '<S106>/Gain1' */ |
| 10007 | L4_MABX_B.Gain1_l = L4_MABX_P.Gain1_Gain_o * L4_MABX_B.Divide_f; |
| 10008 | |
| 10009 | /* Saturate: '<S106>/Saturation1' */ |
| 10010 | DeltaTime = L4_MABX_B.Gain1_l; |
| 10011 | Time56 = L4_MABX_P.Saturation1_LowerSat_n; |
| 10012 | PositionFinalLimited = L4_MABX_P.Saturation1_UpperSat_l; |
| 10013 | if (DeltaTime > PositionFinalLimited) { |
| 10014 | L4_MABX_B.Brake_appl_percent_to_achieve_d = PositionFinalLimited; |
| 10015 | } else if (DeltaTime < Time56) { |
| 10016 | L4_MABX_B.Brake_appl_percent_to_achieve_d = Time56; |
| 10017 | } else { |
| 10018 | L4_MABX_B.Brake_appl_percent_to_achieve_d = DeltaTime; |
| 10019 | } |
| 10020 | |
| 10021 | /* End of Saturate: '<S106>/Saturation1' */ |
| 10022 | |
| 10023 | /* Saturate: '<S81>/Saturation2' incorporates: |
| 10024 | * Constant: '<S81>/ACCEL_LIM_MS2_APV' |
| 10025 | */ |
| 10026 | DeltaTime = L4_MABX_P.ACCEL_LIM_MS2_APV_Value; |
| 10027 | Time56 = L4_MABX_P.Saturation2_LowerSat_l; |
| 10028 | PositionFinalLimited = L4_MABX_P.Saturation2_UpperSat_a; |
| 10029 | if (DeltaTime > PositionFinalLimited) { |
| 10030 | L4_MABX_B.ACCEL_LIM_MS2_APV_b = PositionFinalLimited; |
| 10031 | } else if (DeltaTime < Time56) { |
| 10032 | L4_MABX_B.ACCEL_LIM_MS2_APV_b = Time56; |
| 10033 | } else { |
| 10034 | L4_MABX_B.ACCEL_LIM_MS2_APV_b = DeltaTime; |
| 10035 | } |
| 10036 | |
| 10037 | /* End of Saturate: '<S81>/Saturation2' */ |
| 10038 | |
| 10039 | /* Lookup_n-D: '<S201>/2D_Lookup_Table' */ |
| 10040 | L4_MABX_B.uD_Lookup_Table_i = look2_binlcapw(L4_MABX_B.ACCEL_LIM_MS2_APV_b, |
| 10041 | L4_MABX_B.SPN1760_GrossCombinationVehicle, BRK_GOV_FF_DECEL_RATE_STEP_MPV, |
| 10042 | BRK_GOV_FF_MASS_STEP_MPV, BRK_GOV_FF_PRESS_KPA_DATA_MPV, |
| 10043 | L4_MABX_P.uD_Lookup_Table_maxIndex_n, 16U); |
| 10044 | |
| 10045 | /* Product: '<S106>/Divide1' */ |
| 10046 | L4_MABX_B.Divide1_f = L4_MABX_B.uD_Lookup_Table_i / |
| 10047 | L4_MABX_B.Primary_brake_circuit_pressur_n; |
| 10048 | |
| 10049 | /* Gain: '<S106>/Gain2' */ |
| 10050 | L4_MABX_B.Gain2_e = L4_MABX_P.Gain2_Gain_b * L4_MABX_B.Divide1_f; |
| 10051 | |
| 10052 | /* Saturate: '<S106>/Saturation2' */ |
| 10053 | DeltaTime = L4_MABX_B.Gain2_e; |
| 10054 | Time56 = L4_MABX_P.Saturation2_LowerSat_o; |
| 10055 | PositionFinalLimited = L4_MABX_P.Saturation2_UpperSat_b; |
| 10056 | if (DeltaTime > PositionFinalLimited) { |
| 10057 | L4_MABX_B.Brake_appl_percent_for_maximum_ = PositionFinalLimited; |
| 10058 | } else if (DeltaTime < Time56) { |
| 10059 | L4_MABX_B.Brake_appl_percent_for_maximum_ = Time56; |
| 10060 | } else { |
| 10061 | L4_MABX_B.Brake_appl_percent_for_maximum_ = DeltaTime; |
| 10062 | } |
| 10063 | |
| 10064 | /* End of Saturate: '<S106>/Saturation2' */ |
| 10065 | |
| 10066 | /* DataTypeConversion: '<S77>/Data Type Conversion2' */ |
| 10067 | L4_MABX_B.DataTypeConversion2_l3 = L4_MABX_B.SPN1760_GrossCombinationVehicle; |
| 10068 | |
| 10069 | /* Outputs for Enabled SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' incorporates: |
| 10070 | * EnablePort: '<S103>/Enable' |
| 10071 | */ |
| 10072 | if (L4_MABX_B.F_Brake_control_active) { |
| 10073 | if (!L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba) { |
| 10074 | /* InitializeConditions for UnitDelay: '<S146>/Unit_Delay' */ |
| 10075 | L4_MABX_DW.Unit_Delay_DSTATE_eu = L4_MABX_P.Unit_Delay_InitialCondition_f; |
| 10076 | |
| 10077 | /* InitializeConditions for UnitDelay: '<S153>/Unit_Delay' */ |
| 10078 | L4_MABX_DW.Unit_Delay_DSTATE_nw = L4_MABX_P.Unit_Delay_InitialCondition_jb; |
| 10079 | |
| 10080 | /* InitializeConditions for UnitDelay: '<S173>/Unit_Delay1' */ |
| 10081 | L4_MABX_DW.Unit_Delay1_DSTATE_f = L4_MABX_P.Unit_Delay1_InitialCondition_p; |
| 10082 | |
| 10083 | /* InitializeConditions for UnitDelay: '<S174>/Unit_Delay' */ |
| 10084 | L4_MABX_DW.Unit_Delay_DSTATE_g4 = L4_MABX_P.Unit_Delay_InitialCondition_lq; |
| 10085 | |
| 10086 | /* InitializeConditions for UnitDelay: '<S178>/FixPt Unit Delay2' */ |
| 10087 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_o4 = |
| 10088 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_p; |
| 10089 | |
| 10090 | /* InitializeConditions for UnitDelay: '<S178>/FixPt Unit Delay1' */ |
| 10091 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g2 = |
| 10092 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_b; |
| 10093 | |
| 10094 | /* InitializeConditions for UnitDelay: '<S173>/Unit_Delay2' */ |
| 10095 | L4_MABX_DW.Unit_Delay2_DSTATE_c = L4_MABX_P.Unit_Delay2_InitialCondition_b; |
| 10096 | |
| 10097 | /* InitializeConditions for UnitDelay: '<S145>/Unit_Delay' */ |
| 10098 | L4_MABX_DW.Unit_Delay_DSTATE_h = L4_MABX_P.Unit_Delay_InitialCondition_h; |
| 10099 | L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba = true; |
| 10100 | } |
| 10101 | |
| 10102 | /* Lookup_n-D: '<S147>/1D_Lookup_Table' */ |
| 10103 | L4_MABX_B.uD_Lookup_Table_f = look1_binlcapw |
| 10104 | (L4_MABX_B.DataTypeConversion2_l3, BRK_DEM_MASS_STEP_MPV, |
| 10105 | BRK_DEM_KP_DATA_MPV, 7U); |
| 10106 | |
| 10107 | /* Lookup_n-D: '<S148>/1D_Lookup_Table' */ |
| 10108 | L4_MABX_B.uD_Lookup_Table_p = look1_binlcapw |
| 10109 | (L4_MABX_B.DataTypeConversion2_l3, BRK_DEM_MASS_STEP_MPV, |
| 10110 | BRK_DEM_KI_DATA_MPV, 7U); |
| 10111 | |
| 10112 | /* Lookup_n-D: '<S149>/1D_Lookup_Table' */ |
| 10113 | L4_MABX_B.uD_Lookup_Table_o5 = look1_binlcapw |
| 10114 | (L4_MABX_B.DataTypeConversion2_l3, BRK_DEM_MASS_STEP_MPV, |
| 10115 | BRK_DEM_KD_DATA_MPV, 7U); |
| 10116 | |
| 10117 | /* Abs: '<S150>/Abs' */ |
| 10118 | L4_MABX_B.Abs_k = fabs(L4_MABX_B.uD_Lookup_Table_p); |
| 10119 | |
| 10120 | /* Abs: '<S150>/Abs1' */ |
| 10121 | L4_MABX_B.Abs1_eg = fabs(L4_MABX_B.uD_Lookup_Table_o5); |
| 10122 | |
| 10123 | /* DigitalClock: '<S146>/Digital Clock' */ |
| 10124 | L4_MABX_B.DigitalClock_n = L4_MABX_M->Timing.t[0]; |
| 10125 | |
| 10126 | /* UnitDelay: '<S146>/Unit_Delay' */ |
| 10127 | L4_MABX_B.Unit_Delay_ko = L4_MABX_DW.Unit_Delay_DSTATE_eu; |
| 10128 | |
| 10129 | /* Sum: '<S146>/Subtract' */ |
| 10130 | L4_MABX_B.Subtract_ac = L4_MABX_B.DigitalClock_n - L4_MABX_B.Unit_Delay_ko; |
| 10131 | |
| 10132 | /* UnitDelay: '<S153>/Unit_Delay' */ |
| 10133 | L4_MABX_B.Unit_Delay_m1 = L4_MABX_DW.Unit_Delay_DSTATE_nw; |
| 10134 | |
| 10135 | /* Logic: '<S153>/Logical Operator1' incorporates: |
| 10136 | * Constant: '<S103>/CPV2' |
| 10137 | */ |
| 10138 | L4_MABX_B.LogicalOperator1_pf = (L4_MABX_B.Unit_Delay_m1 || |
| 10139 | L4_MABX_P.CPV2_Value_a); |
| 10140 | |
| 10141 | /* UnitDelay: '<S173>/Unit_Delay1' */ |
| 10142 | L4_MABX_B.Unit_Delay1_jk = L4_MABX_DW.Unit_Delay1_DSTATE_f; |
| 10143 | |
| 10144 | /* Logic: '<S173>/Logical Operator' */ |
| 10145 | L4_MABX_B.LogicalOperator_lo = (L4_MABX_B.LogicalOperator1_pf || |
| 10146 | L4_MABX_B.Unit_Delay1_jk); |
| 10147 | |
| 10148 | /* UnitDelay: '<S174>/Unit_Delay' */ |
| 10149 | L4_MABX_B.Unit_Delay_li = L4_MABX_DW.Unit_Delay_DSTATE_g4; |
| 10150 | |
| 10151 | /* Logic: '<S174>/Logical Operator1' */ |
| 10152 | L4_MABX_B.LogicalOperator1_oy = (L4_MABX_B.LogicalOperator1_pf || |
| 10153 | L4_MABX_B.Unit_Delay_li); |
| 10154 | |
| 10155 | /* UnitDelay: '<S178>/FixPt Unit Delay2' */ |
| 10156 | L4_MABX_B.FixPtUnitDelay2_mf = L4_MABX_DW.FixPtUnitDelay2_DSTATE_o4; |
| 10157 | |
| 10158 | /* UnitDelay: '<S178>/FixPt Unit Delay1' */ |
| 10159 | L4_MABX_B.Xold_c = L4_MABX_DW.FixPtUnitDelay1_DSTATE_g2; |
| 10160 | |
| 10161 | /* Switch: '<S178>/Init' */ |
| 10162 | if (L4_MABX_B.FixPtUnitDelay2_mf != 0) { |
| 10163 | L4_MABX_B.Init_c = L4_MABX_B.Vehicle_speed_target_n; |
| 10164 | } else { |
| 10165 | L4_MABX_B.Init_c = L4_MABX_B.Xold_c; |
| 10166 | } |
| 10167 | |
| 10168 | /* End of Switch: '<S178>/Init' */ |
| 10169 | |
| 10170 | /* Abs: '<S174>/Abs' incorporates: |
| 10171 | * Constant: '<S103>/BRK_DECEL_DEM_SLEW_INC_APV' |
| 10172 | */ |
| 10173 | L4_MABX_B.Abs_o = fabs(L4_MABX_P.BRK_DECEL_DEM_SLEW_INC_APV_Valu); |
| 10174 | |
| 10175 | /* Product: '<S174>/Product1' */ |
| 10176 | L4_MABX_B.Product1_hy = L4_MABX_B.Abs_o * L4_MABX_B.Subtract_ac; |
| 10177 | |
| 10178 | /* Sum: '<S174>/Add1' */ |
| 10179 | L4_MABX_B.Add1_o = L4_MABX_B.Init_c + L4_MABX_B.Product1_hy; |
| 10180 | |
| 10181 | /* MinMax: '<S174>/MinMax2' */ |
| 10182 | DeltaTime = L4_MABX_B.Vehicle_speed_target_n; |
| 10183 | PositionFinalLimited = L4_MABX_B.Add1_o; |
| 10184 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 10185 | PositionFinalLimited = DeltaTime; |
| 10186 | } |
| 10187 | |
| 10188 | L4_MABX_B.MinMax2_p = PositionFinalLimited; |
| 10189 | |
| 10190 | /* End of MinMax: '<S174>/MinMax2' */ |
| 10191 | |
| 10192 | /* Abs: '<S174>/Abs1' incorporates: |
| 10193 | * Constant: '<S103>/BRK_DECEL_DEM_SLEW_DEC_APV' |
| 10194 | */ |
| 10195 | L4_MABX_B.Abs1_g = fabs(L4_MABX_P.BRK_DECEL_DEM_SLEW_DEC_APV_Valu); |
| 10196 | |
| 10197 | /* Product: '<S174>/Product2' */ |
| 10198 | L4_MABX_B.Product2_fh = L4_MABX_B.Subtract_ac * L4_MABX_B.Abs1_g; |
| 10199 | |
| 10200 | /* Sum: '<S174>/Subtract1' */ |
| 10201 | L4_MABX_B.Subtract1_f = L4_MABX_B.Init_c - L4_MABX_B.Product2_fh; |
| 10202 | |
| 10203 | /* MinMax: '<S174>/MinMax1' */ |
| 10204 | DeltaTime = L4_MABX_B.MinMax2_p; |
| 10205 | PositionFinalLimited = L4_MABX_B.Subtract1_f; |
| 10206 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 10207 | PositionFinalLimited = DeltaTime; |
| 10208 | } |
| 10209 | |
| 10210 | L4_MABX_B.MinMax1_hl = PositionFinalLimited; |
| 10211 | |
| 10212 | /* End of MinMax: '<S174>/MinMax1' */ |
| 10213 | |
| 10214 | /* Outputs for Atomic SubSystem: '<S174>/If_Then_Else' */ |
| 10215 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_oy, |
| 10216 | L4_MABX_B.DataTypeConversion5_oo, L4_MABX_B.MinMax1_hl, |
| 10217 | &L4_MABX_B.If_Then_Else_iy); |
| 10218 | |
| 10219 | /* End of Outputs for SubSystem: '<S174>/If_Then_Else' */ |
| 10220 | |
| 10221 | /* Sum: '<S151>/Subtract' */ |
| 10222 | L4_MABX_B.Subtract_jh = L4_MABX_B.If_Then_Else_iy.Switch - |
| 10223 | L4_MABX_B.DataTypeConversion5_oo; |
| 10224 | |
| 10225 | /* MinMax: '<S173>/MinMax1' incorporates: |
| 10226 | * Constant: '<S103>/BRK_DECEL_DEM_T_FILT_CTRL_ERROR_APV' |
| 10227 | */ |
| 10228 | DeltaTime = L4_MABX_B.Subtract_ac; |
| 10229 | PositionFinalLimited = L4_MABX_P.BRK_DECEL_DEM_T_FILT_CTRL_ERROR; |
| 10230 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 10231 | PositionFinalLimited = DeltaTime; |
| 10232 | } |
| 10233 | |
| 10234 | L4_MABX_B.MinMax1_jg = PositionFinalLimited; |
| 10235 | |
| 10236 | /* End of MinMax: '<S173>/MinMax1' */ |
| 10237 | |
| 10238 | /* Saturate: '<S173>/Saturation' */ |
| 10239 | DeltaTime = L4_MABX_B.MinMax1_jg; |
| 10240 | Time56 = L4_MABX_P.Saturation_LowerSat_g; |
| 10241 | PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_o; |
| 10242 | if (DeltaTime > PositionFinalLimited) { |
| 10243 | L4_MABX_B.Saturation_m = PositionFinalLimited; |
| 10244 | } else if (DeltaTime < Time56) { |
| 10245 | L4_MABX_B.Saturation_m = Time56; |
| 10246 | } else { |
| 10247 | L4_MABX_B.Saturation_m = DeltaTime; |
| 10248 | } |
| 10249 | |
| 10250 | /* End of Saturate: '<S173>/Saturation' */ |
| 10251 | |
| 10252 | /* Product: '<S173>/Divide' */ |
| 10253 | L4_MABX_B.Divide_af = L4_MABX_B.Subtract_ac / L4_MABX_B.Saturation_m; |
| 10254 | |
| 10255 | /* Product: '<S173>/Product2' */ |
| 10256 | L4_MABX_B.Product2_ce = L4_MABX_B.Subtract_jh * L4_MABX_B.Divide_af; |
| 10257 | |
| 10258 | /* Sum: '<S173>/Subtract1' incorporates: |
| 10259 | * Constant: '<S173>/Constant1' |
| 10260 | */ |
| 10261 | L4_MABX_B.Subtract1_cr = L4_MABX_P.Constant1_Value_o - L4_MABX_B.Divide_af; |
| 10262 | |
| 10263 | /* UnitDelay: '<S173>/Unit_Delay2' */ |
| 10264 | L4_MABX_B.Unit_Delay2_a = L4_MABX_DW.Unit_Delay2_DSTATE_c; |
| 10265 | |
| 10266 | /* Product: '<S173>/Product1' */ |
| 10267 | L4_MABX_B.Product1_ch = L4_MABX_B.Subtract1_cr * L4_MABX_B.Unit_Delay2_a; |
| 10268 | |
| 10269 | /* Sum: '<S173>/Add1' */ |
| 10270 | L4_MABX_B.Add1_hl = L4_MABX_B.Product2_ce + L4_MABX_B.Product1_ch; |
| 10271 | |
| 10272 | /* Outputs for Atomic SubSystem: '<S173>/If_Then_Else' */ |
| 10273 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_lo, L4_MABX_B.Subtract_jh, |
| 10274 | L4_MABX_B.Add1_hl, &L4_MABX_B.If_Then_Else_bc); |
| 10275 | |
| 10276 | /* End of Outputs for SubSystem: '<S173>/If_Then_Else' */ |
| 10277 | |
| 10278 | /* RelationalOperator: '<S158>/Compare' incorporates: |
| 10279 | * Constant: '<S158>/Constant' |
| 10280 | */ |
| 10281 | L4_MABX_B.Compare_ni = (L4_MABX_B.Abs1_eg > |
| 10282 | L4_MABX_P.CompareToConstant1_const_m); |
| 10283 | |
| 10284 | /* Outputs for Enabled SubSystem: '<S150>/Calculate_D_term' */ |
| 10285 | |
| 10286 | /* Constant: '<S103>/BRK_DECEL_DEM_T_FILT_D_APV' */ |
| 10287 | L4_MABX_Calculate_D_term(L4_MABX_B.Compare_ni, L4_MABX_B.uD_Lookup_Table_o5, |
| 10288 | L4_MABX_B.Subtract_ac, L4_MABX_B.LogicalOperator1_pf, |
| 10289 | L4_MABX_B.If_Then_Else_bc.Switch, |
| 10290 | L4_MABX_P.BRK_DECEL_DEM_T_FILT_D_APV_Valu, &L4_MABX_B.Calculate_D_term_p, |
| 10291 | &L4_MABX_DW.Calculate_D_term_p, &L4_MABX_P.Calculate_D_term_p); |
| 10292 | |
| 10293 | /* End of Outputs for SubSystem: '<S150>/Calculate_D_term' */ |
| 10294 | |
| 10295 | /* Product: '<S156>/Product' */ |
| 10296 | L4_MABX_B.Product_f = L4_MABX_B.uD_Lookup_Table_f * |
| 10297 | L4_MABX_B.If_Then_Else_bc.Switch; |
| 10298 | |
| 10299 | /* UnitDelay: '<S145>/Unit_Delay' */ |
| 10300 | L4_MABX_B.Unit_Delay_fg = L4_MABX_DW.Unit_Delay_DSTATE_h; |
| 10301 | |
| 10302 | /* RelationalOperator: '<S157>/Compare' incorporates: |
| 10303 | * Constant: '<S157>/Constant' |
| 10304 | */ |
| 10305 | L4_MABX_B.Compare_dl = (L4_MABX_B.Abs_k > |
| 10306 | L4_MABX_P.CompareToConstant_const_c); |
| 10307 | |
| 10308 | /* Outputs for Enabled SubSystem: '<S150>/Calculate_I_term' */ |
| 10309 | |
| 10310 | /* Constant: '<S103>/BRK_DECEL_DEM_AW_COND_INT_APV' incorporates: |
| 10311 | * Constant: '<S103>/BRK_DECEL_DEM_AW_HYSTERESIS_APV' |
| 10312 | * Constant: '<S103>/CPV1' |
| 10313 | */ |
| 10314 | L4_MABX_Calculate_I_term(L4_MABX_B.Compare_dl, L4_MABX_B.Product_f, |
| 10315 | L4_MABX_B.uD_Lookup_Table_p, L4_MABX_B.Brake_appl_percent, |
| 10316 | L4_MABX_B.If_Then_Else_bc.Switch, L4_MABX_B.LogicalOperator1_pf, |
| 10317 | L4_MABX_B.Subtract_ac, L4_MABX_B.Brake_appl_percent_to_achieve_d, |
| 10318 | L4_MABX_P.BRK_DECEL_DEM_AW_COND_INT_APV_V, |
| 10319 | L4_MABX_P.BRK_DECEL_DEM_AW_HYSTERESIS_APV, L4_MABX_P.CPV1_Value_no, |
| 10320 | L4_MABX_B.Unit_Delay_fg, &L4_MABX_B.Calculate_I_term_e, |
| 10321 | &L4_MABX_DW.Calculate_I_term_e, &L4_MABX_P.Calculate_I_term_e); |
| 10322 | |
| 10323 | /* End of Outputs for SubSystem: '<S150>/Calculate_I_term' */ |
| 10324 | |
| 10325 | /* RelationalOperator: '<S176>/min_relop' incorporates: |
| 10326 | * Constant: '<S103>/BRK_DECEL_DEM_SLEW_INC_APV' |
| 10327 | * Constant: '<S176>/min_val' |
| 10328 | */ |
| 10329 | L4_MABX_B.min_relop_a = (L4_MABX_P.CheckStaticLowerBound_min_d <= |
| 10330 | L4_MABX_P.BRK_DECEL_DEM_SLEW_INC_APV_Valu); |
| 10331 | |
| 10332 | /* Assertion: '<S176>/Assertion' */ |
| 10333 | utAssert(L4_MABX_B.min_relop_a); |
| 10334 | |
| 10335 | /* Sum: '<S152>/Add' */ |
| 10336 | L4_MABX_B.Add_mh = ((L4_MABX_B.Product_f + |
| 10337 | L4_MABX_B.Calculate_I_term_e.If_Then_Else.Switch) + |
| 10338 | L4_MABX_B.Calculate_D_term_p.Subtract) + |
| 10339 | L4_MABX_B.Brake_appl_percent_to_achieve_d; |
| 10340 | |
| 10341 | /* RelationalOperator: '<S179>/Relational Operator1' */ |
| 10342 | L4_MABX_B.RelationalOperator1_km = (L4_MABX_B.Add_mh >= |
| 10343 | L4_MABX_B.Brake_appl_percent_for_maximum_); |
| 10344 | |
| 10345 | /* RelationalOperator: '<S179>/Relational Operator' incorporates: |
| 10346 | * Constant: '<S103>/CPV' |
| 10347 | */ |
| 10348 | L4_MABX_B.RelationalOperator_m1 = (L4_MABX_B.Add_mh <= L4_MABX_P.CPV_Value_i); |
| 10349 | |
| 10350 | /* Outputs for Atomic SubSystem: '<S179>/If_Then_Else1' */ |
| 10351 | |
| 10352 | /* Constant: '<S103>/CPV' */ |
| 10353 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_m1, L4_MABX_P.CPV_Value_i, |
| 10354 | L4_MABX_B.Add_mh, &L4_MABX_B.If_Then_Else1_gx); |
| 10355 | |
| 10356 | /* End of Outputs for SubSystem: '<S179>/If_Then_Else1' */ |
| 10357 | |
| 10358 | /* Outputs for Atomic SubSystem: '<S179>/If_Then_Else' */ |
| 10359 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_km, |
| 10360 | L4_MABX_B.Brake_appl_percent_for_maximum_, |
| 10361 | L4_MABX_B.If_Then_Else1_gx.Switch, |
| 10362 | &L4_MABX_B.If_Then_Else_fo); |
| 10363 | |
| 10364 | /* End of Outputs for SubSystem: '<S179>/If_Then_Else' */ |
| 10365 | } else { |
| 10366 | if (L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba) { |
| 10367 | /* Disable for Enabled SubSystem: '<S150>/Calculate_D_term' */ |
| 10368 | if (L4_MABX_DW.Calculate_D_term_p.Calculate_D_term_MODE) { |
| 10369 | L4_Calculate_D_term_Disable(&L4_MABX_B.Calculate_D_term_p, |
| 10370 | &L4_MABX_DW.Calculate_D_term_p, &L4_MABX_P.Calculate_D_term_p); |
| 10371 | } |
| 10372 | |
| 10373 | /* End of Disable for SubSystem: '<S150>/Calculate_D_term' */ |
| 10374 | |
| 10375 | /* Disable for Enabled SubSystem: '<S150>/Calculate_I_term' */ |
| 10376 | if (L4_MABX_DW.Calculate_I_term_e.Calculate_I_term_MODE) { |
| 10377 | L4_Calculate_I_term_Disable(&L4_MABX_B.Calculate_I_term_e, |
| 10378 | &L4_MABX_DW.Calculate_I_term_e, &L4_MABX_P.Calculate_I_term_e); |
| 10379 | } |
| 10380 | |
| 10381 | /* End of Disable for SubSystem: '<S150>/Calculate_I_term' */ |
| 10382 | |
| 10383 | /* Disable for Outport: '<S103>/PID_output' */ |
| 10384 | L4_MABX_B.If_Then_Else_fo.Switch = L4_MABX_P.PID_output_Y0_p; |
| 10385 | L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba = false; |
| 10386 | } |
| 10387 | } |
| 10388 | |
| 10389 | /* End of Outputs for SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */ |
| 10390 | |
| 10391 | /* RelationalOperator: '<S104>/Relational Operator2' incorporates: |
| 10392 | * Constant: '<S104>/CPV2' |
| 10393 | */ |
| 10394 | L4_MABX_B.F_Driver_braking = (L4_MABX_B.XPRControlMode == |
| 10395 | L4_MABX_P.CPV2_Value_hm); |
| 10396 | |
| 10397 | /* Logic: '<S104>/Logical Operator2' */ |
| 10398 | L4_MABX_B.F_Operator_brake_appl = (L4_MABX_B.If_Then_Else_l.Switch && |
| 10399 | L4_MABX_B.F_Driver_braking); |
| 10400 | |
| 10401 | /* RelationalOperator: '<S104>/Relational Operator5' incorporates: |
| 10402 | * Constant: '<S104>/BENDIX_2C2_BRAKE_APPL_THRESHOLD_KPA_APV' |
| 10403 | */ |
| 10404 | L4_MABX_B.RelationalOperator5[0] = (L4_MABX_B.Bendix_2C2_Primary_brake_circui > |
| 10405 | L4_MABX_P.BENDIX_2C2_BRAKE_APPL_THRESHOLD); |
| 10406 | L4_MABX_B.RelationalOperator5[1] = (L4_MABX_B.Bendix_2C2_Secondary_brake_circ > |
| 10407 | L4_MABX_P.BENDIX_2C2_BRAKE_APPL_THRESHOLD); |
| 10408 | |
| 10409 | /* Logic: '<S104>/Logical Operator6' */ |
| 10410 | L4_MABX_B.F_Bendix_2C2_service_brake_pres = (L4_MABX_B.RelationalOperator5[0] || |
| 10411 | L4_MABX_B.RelationalOperator5[1]); |
| 10412 | |
| 10413 | /* RelationalOperator: '<S104>/Relational Operator' incorporates: |
| 10414 | * Constant: '<S104>/CPV' |
| 10415 | */ |
| 10416 | L4_MABX_B.F_Bendix_2C2_braking = (L4_MABX_B.XPRControlMode == |
| 10417 | L4_MABX_P.CPV_Value_e); |
| 10418 | |
| 10419 | /* Logic: '<S104>/Logical Operator7' */ |
| 10420 | L4_MABX_B.F_ADAS_brake_appl = (L4_MABX_B.If_Then_Else_l.Switch && |
| 10421 | L4_MABX_B.F_Bendix_2C2_braking && L4_MABX_B.F_Bendix_2C2_service_brake_pres); |
| 10422 | |
| 10423 | /* RelationalOperator: '<S104>/Relational Operator1' incorporates: |
| 10424 | * Constant: '<S104>/CPV1' |
| 10425 | */ |
| 10426 | L4_MABX_B.F_ADAS_brake_error = (L4_MABX_B.XPRErrorState != |
| 10427 | L4_MABX_P.CPV1_Value_i5); |
| 10428 | |
| 10429 | /* Lookup_n-D: '<S199>/2D_Lookup_Table' */ |
| 10430 | L4_MABX_B.uD_Lookup_Table_le = look2_binlcapw |
| 10431 | (L4_MABX_B.brake_system_avg_appl_pressure_, |
| 10432 | L4_MABX_B.SPN1760_GrossCombinationVehicle, BRK_GOV_FF_PRESS_KPA_STEP_MPV, |
| 10433 | BRK_GOV_FF_MASS_STEP_MPV, BRK_GOV_FF_DECEL_RATE_DATA_MPV, |
| 10434 | L4_MABX_P.uD_Lookup_Table_maxIndex_m, 16U); |
| 10435 | |
| 10436 | /* Saturate: '<S106>/Saturation4' */ |
| 10437 | DeltaTime = L4_MABX_B.uD_Lookup_Table_le; |
| 10438 | Time56 = L4_MABX_P.Saturation4_LowerSat_a; |
| 10439 | PositionFinalLimited = L4_MABX_P.Saturation4_UpperSat_f; |
| 10440 | if (DeltaTime > PositionFinalLimited) { |
| 10441 | L4_MABX_B.Decel_rate_calculated_ms2 = PositionFinalLimited; |
| 10442 | } else if (DeltaTime < Time56) { |
| 10443 | L4_MABX_B.Decel_rate_calculated_ms2 = Time56; |
| 10444 | } else { |
| 10445 | L4_MABX_B.Decel_rate_calculated_ms2 = DeltaTime; |
| 10446 | } |
| 10447 | |
| 10448 | /* End of Saturate: '<S106>/Saturation4' */ |
| 10449 | |
| 10450 | /* DataTypeConversion: '<S107>/Data Type Conversion' */ |
| 10451 | L4_MABX_B.DataTypeConversion_pp = L4_MABX_B.SFunction1_o1_ag; |
| 10452 | |
| 10453 | /* DataTypeConversion: '<S107>/Data Type Conversion1' */ |
| 10454 | L4_MABX_B.DataTypeConversion1_k5 = L4_MABX_B.SFunction1_o2_na; |
| 10455 | |
| 10456 | /* Sum: '<S107>/Add' */ |
| 10457 | L4_MABX_B.Add_m = L4_MABX_B.DataTypeConversion_pp + |
| 10458 | L4_MABX_B.DataTypeConversion1_k5; |
| 10459 | |
| 10460 | /* UnitDelay: '<S107>/Unit_Delay' */ |
| 10461 | L4_MABX_B.Unit_Delay_dy = L4_MABX_DW.Unit_Delay_DSTATE_eu4; |
| 10462 | |
| 10463 | /* UnitDelay: '<S203>/Unit_Delay1' */ |
| 10464 | L4_MABX_B.Unit_Delay1_k = L4_MABX_DW.Unit_Delay1_DSTATE_di; |
| 10465 | |
| 10466 | /* Logic: '<S203>/Logical Operator' */ |
| 10467 | L4_MABX_B.LogicalOperator_fc = (L4_MABX_B.Unit_Delay_dy || |
| 10468 | L4_MABX_B.Unit_Delay1_k); |
| 10469 | |
| 10470 | /* Gain: '<S107>/Gain' */ |
| 10471 | L4_MABX_B.Gain_j = L4_MABX_P.Gain_Gain_f * L4_MABX_B.Add_m; |
| 10472 | |
| 10473 | /* MinMax: '<S203>/MinMax1' incorporates: |
| 10474 | * Constant: '<S107>/Constant10' |
| 10475 | * Constant: '<S107>/VSPD_CAN_HRW_0B_FILT_T_APV' |
| 10476 | */ |
| 10477 | DeltaTime = L4_MABX_P.Constant10_Value; |
| 10478 | PositionFinalLimited = L4_MABX_P.VSPD_CAN_HRW_0B_FILT_T_APV_Valu; |
| 10479 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 10480 | PositionFinalLimited = DeltaTime; |
| 10481 | } |
| 10482 | |
| 10483 | L4_MABX_B.MinMax1_i = PositionFinalLimited; |
| 10484 | |
| 10485 | /* End of MinMax: '<S203>/MinMax1' */ |
| 10486 | |
| 10487 | /* Saturate: '<S203>/Saturation' */ |
| 10488 | DeltaTime = L4_MABX_B.MinMax1_i; |
| 10489 | Time56 = L4_MABX_P.Saturation_LowerSat_b; |
| 10490 | PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_l; |
| 10491 | if (DeltaTime > PositionFinalLimited) { |
| 10492 | L4_MABX_B.Saturation_n = PositionFinalLimited; |
| 10493 | } else if (DeltaTime < Time56) { |
| 10494 | L4_MABX_B.Saturation_n = Time56; |
| 10495 | } else { |
| 10496 | L4_MABX_B.Saturation_n = DeltaTime; |
| 10497 | } |
| 10498 | |
| 10499 | /* End of Saturate: '<S203>/Saturation' */ |
| 10500 | |
| 10501 | /* Product: '<S203>/Divide' incorporates: |
| 10502 | * Constant: '<S107>/Constant10' |
| 10503 | */ |
| 10504 | L4_MABX_B.Divide_a = L4_MABX_P.Constant10_Value / L4_MABX_B.Saturation_n; |
| 10505 | |
| 10506 | /* Product: '<S203>/Product2' */ |
| 10507 | L4_MABX_B.Product2_o = L4_MABX_B.Gain_j * L4_MABX_B.Divide_a; |
| 10508 | |
| 10509 | /* Sum: '<S203>/Subtract1' incorporates: |
| 10510 | * Constant: '<S203>/Constant1' |
| 10511 | */ |
| 10512 | L4_MABX_B.Subtract1_e = L4_MABX_P.Constant1_Value_od - L4_MABX_B.Divide_a; |
| 10513 | |
| 10514 | /* UnitDelay: '<S203>/Unit_Delay2' */ |
| 10515 | L4_MABX_B.Unit_Delay2_g = L4_MABX_DW.Unit_Delay2_DSTATE_e; |
| 10516 | |
| 10517 | /* Product: '<S203>/Product1' */ |
| 10518 | L4_MABX_B.Product1_o = L4_MABX_B.Subtract1_e * L4_MABX_B.Unit_Delay2_g; |
| 10519 | |
| 10520 | /* Sum: '<S203>/Add1' */ |
| 10521 | L4_MABX_B.Add1_n1 = L4_MABX_B.Product2_o + L4_MABX_B.Product1_o; |
| 10522 | |
| 10523 | /* Outputs for Atomic SubSystem: '<S203>/If_Then_Else' */ |
| 10524 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_fc, L4_MABX_B.Gain_j, |
| 10525 | L4_MABX_B.Add1_n1, &L4_MABX_B.If_Then_Else_ga); |
| 10526 | |
| 10527 | /* End of Outputs for SubSystem: '<S203>/If_Then_Else' */ |
| 10528 | |
| 10529 | /* SampleTimeMath: '<S202>/TSamp' |
| 10530 | * |
| 10531 | * About '<S202>/TSamp': |
| 10532 | * y = u * K where K = 1 / ( w * Ts ) |
| 10533 | */ |
| 10534 | L4_MABX_B.TSamp = L4_MABX_B.If_Then_Else_ga.Switch * L4_MABX_P.TSamp_WtEt; |
| 10535 | |
| 10536 | /* UnitDelay: '<S202>/UD' */ |
| 10537 | L4_MABX_B.Uk1_b = L4_MABX_DW.UD_DSTATE; |
| 10538 | |
| 10539 | /* Sum: '<S202>/Diff' */ |
| 10540 | L4_MABX_B.Diff = L4_MABX_B.TSamp - L4_MABX_B.Uk1_b; |
| 10541 | |
| 10542 | /* MinMax: '<S77>/MinMax' */ |
| 10543 | DeltaTime = L4_MABX_B.If_Then_Else_n.Switch; |
| 10544 | PositionFinalLimited = L4_MABX_B.If_Then_Else_fo.Switch; |
| 10545 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 10546 | PositionFinalLimited = DeltaTime; |
| 10547 | } |
| 10548 | |
| 10549 | L4_MABX_B.BrakingPID_Y_percent = PositionFinalLimited; |
| 10550 | |
| 10551 | /* End of MinMax: '<S77>/MinMax' */ |
| 10552 | |
| 10553 | /* Gain: '<S77>/Gain' */ |
| 10554 | L4_MABX_B.BrakingPID_Y_k = L4_MABX_P.Gain_Gain_no * |
| 10555 | L4_MABX_B.BrakingPID_Y_percent; |
| 10556 | |
| 10557 | /* DataTypeConversion: '<S79>/Data Type Conversion' */ |
| 10558 | L4_MABX_B.DataTypeConversion_de = AutonomousEnabled; |
| 10559 | |
| 10560 | /* DataTypeConversion: '<S79>/Data Type Conversion2' */ |
| 10561 | L4_MABX_B.DataTypeConversion2_lf = (real32_T)L4_MABX_B.SFunction1_o1_ee; |
| 10562 | |
| 10563 | /* DataTypeConversion: '<S79>/Data Type Conversion1' */ |
| 10564 | PositionFinalLimited = floor(L4_MABX_B.SFunction1_o8_fx); |
| 10565 | if (rtIsNaN(PositionFinalLimited) || rtIsInf(PositionFinalLimited)) { |
| 10566 | PositionFinalLimited = 0.0; |
| 10567 | } else { |
| 10568 | PositionFinalLimited = fmod(PositionFinalLimited, 256.0); |
| 10569 | } |
| 10570 | |
| 10571 | L4_MABX_B.DataTypeConversion1_f1 = (uint8_T)(PositionFinalLimited < 0.0 ? |
| 10572 | (int32_T)(uint8_T)-(int8_T)(uint8_T)-PositionFinalLimited : (int32_T) |
| 10573 | (uint8_T)PositionFinalLimited); |
| 10574 | |
| 10575 | /* End of DataTypeConversion: '<S79>/Data Type Conversion1' */ |
| 10576 | |
| 10577 | /* Chart: '<S79>/Chart' incorporates: |
| 10578 | * Constant: '<S79>/Constant' |
| 10579 | */ |
| 10580 | /* Gateway: STATE_CONTROL_10ms/Chart */ |
| 10581 | /* During: STATE_CONTROL_10ms/Chart */ |
| 10582 | if (L4_MABX_DW.is_active_c19_SUB_L4_Task_10ms_ == 0U) { |
| 10583 | /* Entry: STATE_CONTROL_10ms/Chart */ |
| 10584 | L4_MABX_DW.is_active_c19_SUB_L4_Task_10ms_ = 1U; |
| 10585 | |
| 10586 | /* Entry Internal: STATE_CONTROL_10ms/Chart */ |
| 10587 | /* Transition: '<S207>:2' */ |
| 10588 | L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA = L4_MABX_IN_Init; |
| 10589 | |
| 10590 | /* Entry 'Init': '<S207>:1' */ |
| 10591 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_INIT; |
| 10592 | } else { |
| 10593 | switch (L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA) { |
| 10594 | case L4_MABX_IN_Init: |
| 10595 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_INIT; |
| 10596 | |
| 10597 | /* During 'Init': '<S207>:1' */ |
| 10598 | if (!L4_MABX_P.Constant_Value_cp) { |
| 10599 | /* Transition: '<S207>:9' */ |
| 10600 | L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA = L4_MABX_IN_OperatorDisabled; |
| 10601 | |
| 10602 | /* Entry 'OperatorDisabled': '<S207>:3' */ |
| 10603 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_OPERATOR_DISABLED; |
| 10604 | } |
| 10605 | break; |
| 10606 | |
| 10607 | case L4_MABX_IN_OperatorDisabled: |
| 10608 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_OPERATOR_DISABLED; |
| 10609 | |
| 10610 | /* During 'OperatorDisabled': '<S207>:3' */ |
| 10611 | if (L4_MABX_B.DataTypeConversion_de) { |
| 10612 | /* Transition: '<S207>:11' */ |
| 10613 | L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA = L4_MABX_IN_OperatorEnabled; |
| 10614 | |
| 10615 | /* Entry 'OperatorEnabled': '<S207>:10' */ |
| 10616 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_AUTO_CTRL_ENABLED; |
| 10617 | |
| 10618 | /* Entry Internal 'OperatorEnabled': '<S207>:10' */ |
| 10619 | /* Transition: '<S207>:16' */ |
| 10620 | /* Entry 'AutoControlEnabled': '<S207>:13' */ |
| 10621 | /* Entry Internal 'AutoControlEnabled': '<S207>:13' */ |
| 10622 | /* Transition: '<S207>:15' */ |
| 10623 | /* Entry 'init': '<S207>:14' */ |
| 10624 | L4_MABX_B.VehCtrlState = ENUM_AUTO_CTRL_VEHICLE_STATE_T_INIT; |
| 10625 | } |
| 10626 | break; |
| 10627 | |
| 10628 | default: |
| 10629 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_AUTO_CTRL_ENABLED; |
| 10630 | |
| 10631 | /* During 'OperatorEnabled': '<S207>:10' */ |
| 10632 | if ((!L4_MABX_B.DataTypeConversion_de) || L4_MABX_P.Constant_Value_cp) { |
| 10633 | /* Transition: '<S207>:12' */ |
| 10634 | /* Exit Internal 'OperatorEnabled': '<S207>:10' */ |
| 10635 | /* Exit Internal 'AutoControlEnabled': '<S207>:13' */ |
| 10636 | L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA = L4_MABX_IN_OperatorDisabled; |
| 10637 | |
| 10638 | /* Entry 'OperatorDisabled': '<S207>:3' */ |
| 10639 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_OPERATOR_DISABLED; |
| 10640 | } else { |
| 10641 | /* During 'AutoControlEnabled': '<S207>:13' */ |
| 10642 | L4_MABX_B.VehCtrlState = ENUM_AUTO_CTRL_VEHICLE_STATE_T_INIT; |
| 10643 | |
| 10644 | /* During 'init': '<S207>:14' */ |
| 10645 | } |
| 10646 | break; |
| 10647 | } |
| 10648 | } |
| 10649 | |
| 10650 | /* End of Chart: '<S79>/Chart' */ |
| 10651 | |
| 10652 | /* Outputs for Enabled SubSystem: '<S79>/Engine_speed_target' incorporates: |
| 10653 | * EnablePort: '<S210>/Enable' |
| 10654 | */ |
| 10655 | if (L4_MABX_B.LogicalOperator_k) { |
| 10656 | if (!L4_MABX_DW.Engine_speed_target_MODE) { |
| 10657 | L4_MABX_DW.Engine_speed_target_MODE = true; |
| 10658 | } |
| 10659 | |
| 10660 | /* Gain: '<S210>/KPH_TO_MPH' */ |
| 10661 | L4_MABX_B.KPH_TO_MPH = L4_MABX_P.KPH_TO_MPH_Gain * |
| 10662 | L4_MABX_B.VSPD_TARGET_KPH_APV_g; |
| 10663 | |
| 10664 | /* MinMax: '<S210>/MinMax' incorporates: |
| 10665 | * Constant: '<S210>/Constant2' |
| 10666 | * Constant: '<S210>/TIRE_DIAM_INCHES_APV' |
| 10667 | */ |
| 10668 | DeltaTime = L4_MABX_P.TIRE_DIAM_INCHES_APV_Value; |
| 10669 | PositionFinalLimited = L4_MABX_P.Constant2_Value_m; |
| 10670 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 10671 | PositionFinalLimited = DeltaTime; |
| 10672 | } |
| 10673 | |
| 10674 | L4_MABX_B.MinMax_dl = PositionFinalLimited; |
| 10675 | |
| 10676 | /* End of MinMax: '<S210>/MinMax' */ |
| 10677 | |
| 10678 | /* Product: '<S210>/Divide' incorporates: |
| 10679 | * Constant: '<S210>/CONVERSION_CONSTANT_CPV' |
| 10680 | * Constant: '<S210>/REAR_AXLE_RATIO_VALUE_APV' |
| 10681 | */ |
| 10682 | L4_MABX_B.Divide_p = L4_MABX_B.KPH_TO_MPH * |
| 10683 | L4_MABX_B.SPN526_TransActualGearRatio * |
| 10684 | L4_MABX_P.REAR_AXLE_RATIO_VALUE_APV_Value * |
| 10685 | L4_MABX_P.CONVERSION_CONSTANT_CPV_Value / L4_MABX_B.MinMax_dl; |
| 10686 | |
| 10687 | /* MinMax: '<S210>/MinMax1' incorporates: |
| 10688 | * Constant: '<S210>/Constant1' |
| 10689 | */ |
| 10690 | DeltaTime = L4_MABX_B.Divide_p; |
| 10691 | PositionFinalLimited = L4_MABX_P.Constant1_Value_fx; |
| 10692 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 10693 | PositionFinalLimited = DeltaTime; |
| 10694 | } |
| 10695 | |
| 10696 | L4_MABX_B.MinMax1_n = PositionFinalLimited; |
| 10697 | |
| 10698 | /* End of MinMax: '<S210>/MinMax1' */ |
| 10699 | } else { |
| 10700 | if (L4_MABX_DW.Engine_speed_target_MODE) { |
| 10701 | /* Disable for Outport: '<S210>/Out1' */ |
| 10702 | L4_MABX_B.MinMax1_n = L4_MABX_P.Out1_Y0; |
| 10703 | L4_MABX_DW.Engine_speed_target_MODE = false; |
| 10704 | } |
| 10705 | } |
| 10706 | |
| 10707 | /* End of Outputs for SubSystem: '<S79>/Engine_speed_target' */ |
| 10708 | |
| 10709 | /* RelationalOperator: '<S211>/Relational Operator1' incorporates: |
| 10710 | * Constant: '<S211>/CPV3' |
| 10711 | */ |
| 10712 | L4_MABX_B.RelationalOperator1_cn = (L4_MABX_B.SFunction1_o1_ee <= |
| 10713 | L4_MABX_P.CPV3_Value_n); |
| 10714 | |
| 10715 | /* RelationalOperator: '<S211>/Relational Operator3' incorporates: |
| 10716 | * Constant: '<S211>/CPV1' |
| 10717 | */ |
| 10718 | L4_MABX_B.RelationalOperator3_g = (L4_MABX_B.SPN524_TransSelectedGear == |
| 10719 | L4_MABX_P.CPV1_Value_n); |
| 10720 | |
| 10721 | /* RelationalOperator: '<S211>/Relational Operator2' incorporates: |
| 10722 | * Constant: '<S211>/CPV2' |
| 10723 | */ |
| 10724 | L4_MABX_B.RelationalOperator2_f = (L4_MABX_B.SPN523_TransCurrentGear == |
| 10725 | L4_MABX_P.CPV2_Value_h); |
| 10726 | |
| 10727 | /* RelationalOperator: '<S211>/Relational Operator4' incorporates: |
| 10728 | * Constant: '<S211>/CPV5' |
| 10729 | */ |
| 10730 | L4_MABX_B.RelationalOperator4_o = (L4_MABX_B.SFunction1_o2_bb == |
| 10731 | L4_MABX_P.CPV5_Value_g); |
| 10732 | |
| 10733 | /* Logic: '<S211>/Logical Operator' */ |
| 10734 | L4_MABX_B.F_Ignition_sw_off_conditions_me = (L4_MABX_B.RelationalOperator1_cn && |
| 10735 | L4_MABX_B.RelationalOperator3_g && L4_MABX_B.RelationalOperator2_f && |
| 10736 | L4_MABX_B.RelationalOperator4_o); |
| 10737 | |
| 10738 | /* RelationalOperator: '<S211>/Relational Operator' incorporates: |
| 10739 | * Constant: '<S211>/IGN_SW_VOLTAGE_THRESHOLD_APV' |
| 10740 | */ |
| 10741 | L4_MABX_B.F_Ignition_sw_on = (L4_MABX_B.IgnitionKeySwitch_voltage >= |
| 10742 | L4_MABX_P.IGN_SW_VOLTAGE_THRESHOLD_APV_Va); |
| 10743 | |
| 10744 | /* SignalConversion: '<S218>/TmpSignal ConversionAt SFunction Inport3' incorporates: |
| 10745 | * Chart: '<S211>/Relay_control_state_machine' |
| 10746 | * Constant: '<S211>/IGN_RELAY_ON_DELAY_SECS_APV' |
| 10747 | * Constant: '<S211>/INVERTER_RELAY_ON_DELAY_SECS_APV' |
| 10748 | * Constant: '<S211>/MABX_RELAY_ON_DELAY_SECS_APV' |
| 10749 | * Constant: '<S211>/SENSOR_RELAY_ON_DELAY_SECS_APV' |
| 10750 | */ |
| 10751 | L4_MABX_B.TmpSignalConversionAtSFunctionI[0] = |
| 10752 | L4_MABX_P.IGN_RELAY_ON_DELAY_SECS_APV_Val; |
| 10753 | L4_MABX_B.TmpSignalConversionAtSFunctionI[1] = |
| 10754 | L4_MABX_P.INVERTER_RELAY_ON_DELAY_SECS_AP; |
| 10755 | L4_MABX_B.TmpSignalConversionAtSFunctionI[2] = |
| 10756 | L4_MABX_P.MABX_RELAY_ON_DELAY_SECS_APV_Va; |
| 10757 | L4_MABX_B.TmpSignalConversionAtSFunctionI[3] = |
| 10758 | L4_MABX_P.SENSOR_RELAY_ON_DELAY_SECS_APV_; |
| 10759 | |
| 10760 | /* SignalConversion: '<S218>/TmpSignal ConversionAt SFunction Inport4' incorporates: |
| 10761 | * Chart: '<S211>/Relay_control_state_machine' |
| 10762 | * Constant: '<S211>/IGN_RELAY_OFF_DELAY_SECS_APV' |
| 10763 | * Constant: '<S211>/INVERTER_RELAY_OFF_DELAY_SECS_APV' |
| 10764 | * Constant: '<S211>/MABX_RELAY_OFF_DELAY_SECS_APV' |
| 10765 | * Constant: '<S211>/SENSOR_RELAY_OFF_DELAY_SECS_APV' |
| 10766 | */ |
| 10767 | L4_MABX_B.TmpSignalConversionAtSFunctio_k[0] = |
| 10768 | L4_MABX_P.IGN_RELAY_OFF_DELAY_SECS_APV_Va; |
| 10769 | L4_MABX_B.TmpSignalConversionAtSFunctio_k[1] = |
| 10770 | L4_MABX_P.INVERTER_RELAY_OFF_DELAY_SECS_A; |
| 10771 | L4_MABX_B.TmpSignalConversionAtSFunctio_k[2] = |
| 10772 | L4_MABX_P.MABX_RELAY_OFF_DELAY_SECS_APV_V; |
| 10773 | L4_MABX_B.TmpSignalConversionAtSFunctio_k[3] = |
| 10774 | L4_MABX_P.SENSOR_RELAY_OFF_DELAY_SECS_APV; |
| 10775 | |
| 10776 | /* Chart: '<S211>/Relay_control_state_machine' */ |
| 10777 | if (L4_MABX_DW.temporalCounter_i1 < MAX_uint32_T) { |
| 10778 | L4_MABX_DW.temporalCounter_i1++; |
| 10779 | } |
| 10780 | |
| 10781 | /* Gateway: STATE_CONTROL_10ms/Relay_control/Relay_control_state_machine */ |
| 10782 | /* During: STATE_CONTROL_10ms/Relay_control/Relay_control_state_machine */ |
| 10783 | if (L4_MABX_DW.is_active_c6_SUB_L4_Task_10ms_S == 0U) { |
| 10784 | /* Entry: STATE_CONTROL_10ms/Relay_control/Relay_control_state_machine */ |
| 10785 | L4_MABX_DW.is_active_c6_SUB_L4_Task_10ms_S = 1U; |
| 10786 | |
| 10787 | /* Entry Internal: STATE_CONTROL_10ms/Relay_control/Relay_control_state_machine */ |
| 10788 | /* Transition: '<S218>:13' */ |
| 10789 | L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT = L4_MABX_IN_INITIAL; |
| 10790 | L4_MABX_enter_atomic_INITIAL(); |
| 10791 | } else { |
| 10792 | switch (L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT) { |
| 10793 | case L4_MABX_IN_INITIAL: |
| 10794 | L4_MABX_B.F_Ignition_relay_command_i = false; |
| 10795 | L4_MABX_B.F_Inverter_relay_command_p = false; |
| 10796 | L4_MABX_B.F_MABX_relay_command_n = false; |
| 10797 | L4_MABX_B.F_Sensor_relay_command_k = false; |
| 10798 | |
| 10799 | /* During 'INITIAL': '<S218>:12' */ |
| 10800 | if (L4_MABX_B.F_Ignition_sw_on) { |
| 10801 | /* Transition: '<S218>:17' */ |
| 10802 | L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT = L4_MABX_IN_POWER_UP_ROUTINE; |
| 10803 | |
| 10804 | /* Entry Internal 'POWER_UP_ROUTINE': '<S218>:16' */ |
| 10805 | /* Transition: '<S218>:64' */ |
| 10806 | L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_WAIT; |
| 10807 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 10808 | } |
| 10809 | break; |
| 10810 | |
| 10811 | case L4_MABX_IN_POWER_DOWN_ROUTINE: |
| 10812 | /* During 'POWER_DOWN_ROUTINE': '<S218>:30' */ |
| 10813 | switch (L4_MABX_DW.is_POWER_DOWN_ROUTINE) { |
| 10814 | case L4_MABX_IN_IGN_RELAY_UNLATCH: |
| 10815 | L4_MABX_B.F_Ignition_relay_command_i = false; |
| 10816 | |
| 10817 | /* During 'IGN_RELAY_UNLATCH': '<S218>:29' */ |
| 10818 | if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil |
| 10819 | (L4_MABX_DW.INVERTER_RELAY_OFF_DELAY_SECS_A * 100.0)) { |
| 10820 | /* Transition: '<S218>:23' */ |
| 10821 | L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_INV_RELAY_UNLATCH; |
| 10822 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 10823 | |
| 10824 | /* Entry 'INV_RELAY_UNLATCH': '<S218>:28' */ |
| 10825 | L4_MABX_B.F_Inverter_relay_command_p = false; |
| 10826 | } |
| 10827 | break; |
| 10828 | |
| 10829 | case L4_MABX_IN_INV_RELAY_UNLATCH: |
| 10830 | L4_MABX_B.F_Inverter_relay_command_p = false; |
| 10831 | |
| 10832 | /* During 'INV_RELAY_UNLATCH': '<S218>:28' */ |
| 10833 | if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil |
| 10834 | (L4_MABX_DW.SENSOR_RELAY_OFF_DELAY_SECS_APV * 100.0)) { |
| 10835 | /* Transition: '<S218>:22' */ |
| 10836 | L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_SENSOR_RELAY_UNLATCH; |
| 10837 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 10838 | |
| 10839 | /* Entry 'SENSOR_RELAY_UNLATCH': '<S218>:25' */ |
| 10840 | L4_MABX_B.F_Sensor_relay_command_k = false; |
| 10841 | } |
| 10842 | break; |
| 10843 | |
| 10844 | case L4_MABX_IN_MABX_RELAY_UNLATCH: |
| 10845 | L4_MABX_B.F_MABX_relay_command_n = false; |
| 10846 | |
| 10847 | /* During 'MABX_RELAY_UNLATCH': '<S218>:27' */ |
| 10848 | /* Transition: '<S218>:45' */ |
| 10849 | /* Transition: '<S218>:46' */ |
| 10850 | /* Transition: '<S218>:47' */ |
| 10851 | /* Transition: '<S218>:48' */ |
| 10852 | L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 10853 | L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT = L4_MABX_IN_INITIAL; |
| 10854 | L4_MABX_enter_atomic_INITIAL(); |
| 10855 | break; |
| 10856 | |
| 10857 | case L4_MABX_IN_SENSOR_RELAY_UNLATCH: |
| 10858 | L4_MABX_B.F_Sensor_relay_command_k = false; |
| 10859 | |
| 10860 | /* During 'SENSOR_RELAY_UNLATCH': '<S218>:25' */ |
| 10861 | if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil |
| 10862 | (L4_MABX_DW.MABX_RELAY_OFF_DELAY_SECS_APV * 100.0)) { |
| 10863 | /* Transition: '<S218>:26' */ |
| 10864 | L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_MABX_RELAY_UNLATCH; |
| 10865 | |
| 10866 | /* Entry 'MABX_RELAY_UNLATCH': '<S218>:27' */ |
| 10867 | L4_MABX_B.F_MABX_relay_command_n = false; |
| 10868 | } |
| 10869 | break; |
| 10870 | |
| 10871 | default: |
| 10872 | /* During 'WAIT': '<S218>:65' */ |
| 10873 | if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil |
| 10874 | (L4_MABX_DW.IGN_RELAY_OFF_DELAY_SECS_APV * 100.0)) { |
| 10875 | /* Transition: '<S218>:55' */ |
| 10876 | L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_IGN_RELAY_UNLATCH; |
| 10877 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 10878 | |
| 10879 | /* Entry 'IGN_RELAY_UNLATCH': '<S218>:29' */ |
| 10880 | L4_MABX_B.F_Ignition_relay_command_i = false; |
| 10881 | } |
| 10882 | break; |
| 10883 | } |
| 10884 | break; |
| 10885 | |
| 10886 | default: |
| 10887 | /* During 'POWER_UP_ROUTINE': '<S218>:16' */ |
| 10888 | zcEvent = ((!L4_MABX_B.F_Ignition_sw_on) && |
| 10889 | L4_MABX_B.F_Ignition_sw_off_conditions_me); |
| 10890 | if (zcEvent) { |
| 10891 | /* Transition: '<S218>:31' */ |
| 10892 | /* Exit Internal 'POWER_UP_ROUTINE': '<S218>:16' */ |
| 10893 | L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 10894 | L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT = |
| 10895 | L4_MABX_IN_POWER_DOWN_ROUTINE; |
| 10896 | |
| 10897 | /* Entry Internal 'POWER_DOWN_ROUTINE': '<S218>:30' */ |
| 10898 | /* Transition: '<S218>:66' */ |
| 10899 | L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_WAIT; |
| 10900 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 10901 | } else { |
| 10902 | switch (L4_MABX_DW.is_POWER_UP_ROUTINE) { |
| 10903 | case L4_MABX_IN_IGN_RELAY_LATCH: |
| 10904 | L4_MABX_B.F_Ignition_relay_command_i = true; |
| 10905 | |
| 10906 | /* During 'IGN_RELAY_LATCH': '<S218>:20' */ |
| 10907 | break; |
| 10908 | |
| 10909 | case L4_MABX_IN_INV_RELAY_LATCH: |
| 10910 | L4_MABX_B.F_Inverter_relay_command_p = true; |
| 10911 | |
| 10912 | /* During 'INV_RELAY_LATCH': '<S218>:19' */ |
| 10913 | if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil |
| 10914 | (L4_MABX_DW.IGN_RELAY_ON_DELAY_SECS_APV * 100.0)) { |
| 10915 | /* Transition: '<S218>:21' */ |
| 10916 | L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_IGN_RELAY_LATCH; |
| 10917 | |
| 10918 | /* Entry 'IGN_RELAY_LATCH': '<S218>:20' */ |
| 10919 | L4_MABX_B.F_Ignition_relay_command_i = true; |
| 10920 | } |
| 10921 | break; |
| 10922 | |
| 10923 | case L4_MABX_IN_MABX_RELAY_LATCH: |
| 10924 | L4_MABX_B.F_MABX_relay_command_n = true; |
| 10925 | |
| 10926 | /* During 'MABX_RELAY_LATCH': '<S218>:10' */ |
| 10927 | if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil |
| 10928 | (L4_MABX_DW.SENSOR_RELAY_ON_DELAY_SECS_APV * 100.0)) { |
| 10929 | /* Transition: '<S218>:15' */ |
| 10930 | L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_SENSOR_RELAY_LATCH; |
| 10931 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 10932 | |
| 10933 | /* Entry 'SENSOR_RELAY_LATCH': '<S218>:14' */ |
| 10934 | L4_MABX_B.F_Sensor_relay_command_k = true; |
| 10935 | } |
| 10936 | break; |
| 10937 | |
| 10938 | case L4_MABX_IN_SENSOR_RELAY_LATCH: |
| 10939 | L4_MABX_B.F_Sensor_relay_command_k = true; |
| 10940 | |
| 10941 | /* During 'SENSOR_RELAY_LATCH': '<S218>:14' */ |
| 10942 | if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil |
| 10943 | (L4_MABX_DW.INVERTER_RELAY_ON_DELAY_SECS_AP * 100.0)) { |
| 10944 | /* Transition: '<S218>:18' */ |
| 10945 | L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_INV_RELAY_LATCH; |
| 10946 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 10947 | |
| 10948 | /* Entry 'INV_RELAY_LATCH': '<S218>:19' */ |
| 10949 | L4_MABX_B.F_Inverter_relay_command_p = true; |
| 10950 | } |
| 10951 | break; |
| 10952 | |
| 10953 | default: |
| 10954 | /* During 'WAIT': '<S218>:63' */ |
| 10955 | if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil |
| 10956 | (L4_MABX_DW.MABX_RELAY_ON_DELAY_SECS_APV * 100.0)) { |
| 10957 | /* Transition: '<S218>:11' */ |
| 10958 | L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_MABX_RELAY_LATCH; |
| 10959 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 10960 | |
| 10961 | /* Entry 'MABX_RELAY_LATCH': '<S218>:10' */ |
| 10962 | L4_MABX_B.F_MABX_relay_command_n = true; |
| 10963 | } |
| 10964 | break; |
| 10965 | } |
| 10966 | } |
| 10967 | break; |
| 10968 | } |
| 10969 | } |
| 10970 | |
| 10971 | /* Lookup_n-D: '<S79>/CurveBasedSpeedSetpoint' incorporates: |
| 10972 | * Constant: '<S80>/zero' |
| 10973 | */ |
| 10974 | L4_MABX_B.CurveBasedSpeedSetpoint = look1_binlcapw(L4_MABX_P.zero_Value, |
| 10975 | L4_MABX_P.CurveBasedSpeedSetpoint_bp01Dat, |
| 10976 | L4_MABX_P.CurveBasedSpeedSetpoint_tableDa, 4U); |
| 10977 | |
| 10978 | /* Lookup_n-D: '<S80>/1-D Lookup Table1' */ |
| 10979 | L4_MABX_B.uDLookupTable1 = look1_binlxpw(SteerWheelAngle, |
| 10980 | L4_MABX_P.uDLookupTable1_bp01Data, L4_MABX_P.uDLookupTable1_tableData, 16U); |
| 10981 | |
| 10982 | /* Product: '<S285>/Divide' incorporates: |
| 10983 | * Constant: '<S277>/Constant' |
| 10984 | * Constant: '<S277>/Constant1' |
| 10985 | */ |
| 10986 | L4_MABX_B.Divide_nn = (real32_T)(L4_MABX_P.Constant1_Value_i / |
| 10987 | L4_MABX_P.Constant_Value_e); |
| 10988 | |
| 10989 | /* DataTypeConversion: '<S80>/Data Type Conversion5' */ |
| 10990 | PositionFinalLimited = floor(L4_MABX_B.SFunction1_o2_b); |
| 10991 | if (rtIsNaN(PositionFinalLimited) || rtIsInf(PositionFinalLimited)) { |
| 10992 | PositionFinalLimited = 0.0; |
| 10993 | } else { |
| 10994 | PositionFinalLimited = fmod(PositionFinalLimited, 256.0); |
| 10995 | } |
| 10996 | |
| 10997 | L4_MABX_B.DataTypeConversion5_e3d = (uint8_T)(PositionFinalLimited < 0.0 ? |
| 10998 | (int32_T)(uint8_T)-(int8_T)(uint8_T)-PositionFinalLimited : (int32_T) |
| 10999 | (uint8_T)PositionFinalLimited); |
| 11000 | |
| 11001 | /* End of DataTypeConversion: '<S80>/Data Type Conversion5' */ |
| 11002 | |
| 11003 | /* Chart: '<S283>/Chart' */ |
| 11004 | /* Gateway: STEERCTRL_10ms/slew/Chart */ |
| 11005 | /* During: STEERCTRL_10ms/slew/Chart */ |
| 11006 | if (L4_MABX_DW.is_active_c12_SUB_L4_Task_10ms_ == 0U) { |
| 11007 | /* Entry: STEERCTRL_10ms/slew/Chart */ |
| 11008 | L4_MABX_DW.is_active_c12_SUB_L4_Task_10ms_ = 1U; |
| 11009 | |
| 11010 | /* Entry Internal: STEERCTRL_10ms/slew/Chart */ |
| 11011 | /* Transition: '<S333>:4' */ |
| 11012 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_init_h; |
| 11013 | |
| 11014 | /* Entry 'init': '<S333>:1' */ |
| 11015 | L4_MABX_B.stateChange = 0U; |
| 11016 | } else { |
| 11017 | switch (L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE) { |
| 11018 | case L4_MABX_IN_OneLane: |
| 11019 | /* During 'OneLane': '<S333>:7' */ |
| 11020 | /* Transition: '<S333>:20' */ |
| 11021 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_OneLane1; |
| 11022 | |
| 11023 | /* Entry 'OneLane1': '<S333>:18' */ |
| 11024 | L4_MABX_B.stateChange = 0U; |
| 11025 | break; |
| 11026 | |
| 11027 | case L4_MABX_IN_OneLane1: |
| 11028 | L4_MABX_B.stateChange = 0U; |
| 11029 | |
| 11030 | /* During 'OneLane1': '<S333>:18' */ |
| 11031 | zcEvent = ((L4_MABX_B.DataTypeConversion5_e3d < 3) || |
| 11032 | (L4_MABX_B.DataTypeConversion5_e3d > 18)); |
| 11033 | if (zcEvent) { |
| 11034 | /* Transition: '<S333>:22' */ |
| 11035 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_init_h; |
| 11036 | |
| 11037 | /* Entry 'init': '<S333>:1' */ |
| 11038 | L4_MABX_B.stateChange = 0U; |
| 11039 | } |
| 11040 | break; |
| 11041 | |
| 11042 | case L4_MABX_IN_TwoLanes: |
| 11043 | /* During 'TwoLanes': '<S333>:8' */ |
| 11044 | /* Transition: '<S333>:21' */ |
| 11045 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_TwoLanes1; |
| 11046 | |
| 11047 | /* Entry 'TwoLanes1': '<S333>:19' */ |
| 11048 | L4_MABX_B.stateChange = 0U; |
| 11049 | break; |
| 11050 | |
| 11051 | case L4_MABX_IN_TwoLanes1: |
| 11052 | L4_MABX_B.stateChange = 0U; |
| 11053 | |
| 11054 | /* During 'TwoLanes1': '<S333>:19' */ |
| 11055 | if (L4_MABX_B.DataTypeConversion5_e3d < 18) { |
| 11056 | /* Transition: '<S333>:23' */ |
| 11057 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_init_h; |
| 11058 | |
| 11059 | /* Entry 'init': '<S333>:1' */ |
| 11060 | L4_MABX_B.stateChange = 0U; |
| 11061 | } |
| 11062 | break; |
| 11063 | |
| 11064 | case L4_MABX_IN_ZeroLanes: |
| 11065 | /* During 'ZeroLanes': '<S333>:5' */ |
| 11066 | /* Transition: '<S333>:16' */ |
| 11067 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_ZeroLanes1; |
| 11068 | |
| 11069 | /* Entry 'ZeroLanes1': '<S333>:15' */ |
| 11070 | L4_MABX_B.stateChange = 0U; |
| 11071 | break; |
| 11072 | |
| 11073 | case L4_MABX_IN_ZeroLanes1: |
| 11074 | L4_MABX_B.stateChange = 0U; |
| 11075 | |
| 11076 | /* During 'ZeroLanes1': '<S333>:15' */ |
| 11077 | if (L4_MABX_B.DataTypeConversion5_e3d > 3) { |
| 11078 | /* Transition: '<S333>:17' */ |
| 11079 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_init_h; |
| 11080 | |
| 11081 | /* Entry 'init': '<S333>:1' */ |
| 11082 | L4_MABX_B.stateChange = 0U; |
| 11083 | } |
| 11084 | break; |
| 11085 | |
| 11086 | default: |
| 11087 | L4_MABX_B.stateChange = 0U; |
| 11088 | |
| 11089 | /* During 'init': '<S333>:1' */ |
| 11090 | if (L4_MABX_B.DataTypeConversion5_e3d <= 3) { |
| 11091 | /* Transition: '<S333>:6' */ |
| 11092 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_ZeroLanes; |
| 11093 | |
| 11094 | /* Entry 'ZeroLanes': '<S333>:5' */ |
| 11095 | L4_MABX_B.stateChange = 1U; |
| 11096 | } else if (L4_MABX_B.DataTypeConversion5_e3d > 18) { |
| 11097 | /* Transition: '<S333>:9' */ |
| 11098 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_TwoLanes; |
| 11099 | |
| 11100 | /* Entry 'TwoLanes': '<S333>:8' */ |
| 11101 | L4_MABX_B.stateChange = 1U; |
| 11102 | } else { |
| 11103 | if (L4_MABX_B.DataTypeConversion5_e3d > 3) { |
| 11104 | /* Transition: '<S333>:10' */ |
| 11105 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_OneLane; |
| 11106 | |
| 11107 | /* Entry 'OneLane': '<S333>:7' */ |
| 11108 | L4_MABX_B.stateChange = 1U; |
| 11109 | } |
| 11110 | } |
| 11111 | break; |
| 11112 | } |
| 11113 | } |
| 11114 | |
| 11115 | /* End of Chart: '<S283>/Chart' */ |
| 11116 | |
| 11117 | /* DataTypeConversion: '<S283>/Data Type Conversion' */ |
| 11118 | L4_MABX_B.DataTypeConversion_l1 = (L4_MABX_B.stateChange != 0); |
| 11119 | |
| 11120 | /* UnitDelay: '<S327>/Unit_Delay1' */ |
| 11121 | L4_MABX_B.Unit_Delay1_j = L4_MABX_DW.Unit_Delay1_DSTATE_db; |
| 11122 | |
| 11123 | /* Logic: '<S327>/Logical Operator' incorporates: |
| 11124 | * Constant: '<S282>/zero' |
| 11125 | */ |
| 11126 | L4_MABX_B.LogicalOperator_kh = (L4_MABX_P.zero_Value_g || |
| 11127 | L4_MABX_B.Unit_Delay1_j); |
| 11128 | |
| 11129 | /* MinMax: '<S327>/MinMax1' incorporates: |
| 11130 | * Constant: '<S282>/timeConstant' |
| 11131 | * Constant: '<S282>/timeConstant1' |
| 11132 | */ |
| 11133 | DeltaTime = L4_MABX_P.timeConstant1_Value; |
| 11134 | PositionFinalLimited = L4_MABX_P.timeConstant_Value; |
| 11135 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 11136 | PositionFinalLimited = DeltaTime; |
| 11137 | } |
| 11138 | |
| 11139 | L4_MABX_B.MinMax1_pr = PositionFinalLimited; |
| 11140 | |
| 11141 | /* End of MinMax: '<S327>/MinMax1' */ |
| 11142 | |
| 11143 | /* Saturate: '<S327>/Saturation' */ |
| 11144 | DeltaTime = L4_MABX_B.MinMax1_pr; |
| 11145 | Time56 = L4_MABX_P.Saturation_LowerSat_p2; |
| 11146 | PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_o1; |
| 11147 | if (DeltaTime > PositionFinalLimited) { |
| 11148 | L4_MABX_B.Saturation_ns = PositionFinalLimited; |
| 11149 | } else if (DeltaTime < Time56) { |
| 11150 | L4_MABX_B.Saturation_ns = Time56; |
| 11151 | } else { |
| 11152 | L4_MABX_B.Saturation_ns = DeltaTime; |
| 11153 | } |
| 11154 | |
| 11155 | /* End of Saturate: '<S327>/Saturation' */ |
| 11156 | |
| 11157 | /* Product: '<S327>/Divide' incorporates: |
| 11158 | * Constant: '<S282>/timeConstant1' |
| 11159 | */ |
| 11160 | L4_MABX_B.Divide_o = L4_MABX_P.timeConstant1_Value / L4_MABX_B.Saturation_ns; |
| 11161 | |
| 11162 | /* Product: '<S327>/Product2' */ |
| 11163 | L4_MABX_B.Product2_b = L4_MABX_B.SFunction1_o3_pj * L4_MABX_B.Divide_o; |
| 11164 | |
| 11165 | /* Sum: '<S327>/Subtract1' incorporates: |
| 11166 | * Constant: '<S327>/Constant1' |
| 11167 | */ |
| 11168 | L4_MABX_B.Subtract1_ei = L4_MABX_P.Constant1_Value_n - L4_MABX_B.Divide_o; |
| 11169 | |
| 11170 | /* UnitDelay: '<S327>/Unit_Delay2' */ |
| 11171 | L4_MABX_B.Unit_Delay2_k = L4_MABX_DW.Unit_Delay2_DSTATE_d; |
| 11172 | |
| 11173 | /* Product: '<S327>/Product1' */ |
| 11174 | L4_MABX_B.Product1_n = L4_MABX_B.Subtract1_ei * L4_MABX_B.Unit_Delay2_k; |
| 11175 | |
| 11176 | /* Sum: '<S327>/Add1' */ |
| 11177 | L4_MABX_B.Add1_kr = L4_MABX_B.Product2_b + L4_MABX_B.Product1_n; |
| 11178 | |
| 11179 | /* Outputs for Atomic SubSystem: '<S327>/If_Then_Else' */ |
| 11180 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_kh, L4_MABX_B.SFunction1_o3_pj, |
| 11181 | L4_MABX_B.Add1_kr, &L4_MABX_B.If_Then_Else_b3); |
| 11182 | |
| 11183 | /* End of Outputs for SubSystem: '<S327>/If_Then_Else' */ |
| 11184 | |
| 11185 | /* Abs: '<S282>/Abs' */ |
| 11186 | L4_MABX_B.Abs_i = fabs(L4_MABX_B.SFunction1_o3_pj); |
| 11187 | |
| 11188 | /* Sum: '<S282>/Add' */ |
| 11189 | L4_MABX_B.Add_p = L4_MABX_B.Abs_i - L4_MABX_B.If_Then_Else_b3.Switch; |
| 11190 | |
| 11191 | /* RelationalOperator: '<S282>/highRateOfChange' incorporates: |
| 11192 | * Constant: '<S282>/rateOfChangeThreshold' |
| 11193 | */ |
| 11194 | L4_MABX_B.highRateOfChange = (L4_MABX_B.Add_p > |
| 11195 | L4_MABX_P.rateOfChangeThreshold_Value); |
| 11196 | |
| 11197 | /* RelationalOperator: '<S282>/closeToEdge' incorporates: |
| 11198 | * Constant: '<S282>/closeToLaneEdgeThreshold' |
| 11199 | */ |
| 11200 | L4_MABX_B.closeToEdge = (L4_MABX_B.Abs_i > |
| 11201 | L4_MABX_P.closeToLaneEdgeThreshold_Value); |
| 11202 | |
| 11203 | /* Logic: '<S282>/JumpNearEdge' */ |
| 11204 | L4_MABX_B.JumpNearEdge = (L4_MABX_B.highRateOfChange && L4_MABX_B.closeToEdge); |
| 11205 | |
| 11206 | /* UnitDelay: '<S326>/Delay Input1' */ |
| 11207 | L4_MABX_B.Uk1_k2x = L4_MABX_DW.DelayInput1_DSTATE_f0; |
| 11208 | |
| 11209 | /* RelationalOperator: '<S326>/FixPt Relational Operator' */ |
| 11210 | L4_MABX_B.FixPtRelationalOperator_iv = (L4_MABX_B.JumpNearEdge != |
| 11211 | L4_MABX_B.Uk1_k2x); |
| 11212 | |
| 11213 | /* DataTypeConversion: '<S282>/Data Type Conversion' */ |
| 11214 | L4_MABX_B.DataTypeConversion_dz = L4_MABX_B.FixPtRelationalOperator_iv; |
| 11215 | |
| 11216 | /* UnitDelay: '<S328>/Unit_Delay1' */ |
| 11217 | L4_MABX_B.Unit_Delay1_f = L4_MABX_DW.Unit_Delay1_DSTATE_as; |
| 11218 | |
| 11219 | /* Logic: '<S328>/Logical Operator' */ |
| 11220 | L4_MABX_B.LogicalOperator_a3 = (L4_MABX_B.DataTypeConversion_dz || |
| 11221 | L4_MABX_B.Unit_Delay1_f); |
| 11222 | |
| 11223 | /* Switch: '<S282>/Switch' incorporates: |
| 11224 | * Constant: '<S282>/correction' |
| 11225 | * Constant: '<S282>/zero1' |
| 11226 | */ |
| 11227 | if (L4_MABX_B.JumpNearEdge) { |
| 11228 | L4_MABX_B.Switch_g = L4_MABX_P.correction_Value; |
| 11229 | } else { |
| 11230 | L4_MABX_B.Switch_g = L4_MABX_P.zero1_Value; |
| 11231 | } |
| 11232 | |
| 11233 | /* End of Switch: '<S282>/Switch' */ |
| 11234 | |
| 11235 | /* MinMax: '<S328>/MinMax1' incorporates: |
| 11236 | * Constant: '<S282>/timeConstant2' |
| 11237 | * Constant: '<S282>/timeConstant3' |
| 11238 | */ |
| 11239 | DeltaTime = L4_MABX_P.timeConstant3_Value; |
| 11240 | PositionFinalLimited = L4_MABX_P.timeConstant2_Value; |
| 11241 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 11242 | PositionFinalLimited = DeltaTime; |
| 11243 | } |
| 11244 | |
| 11245 | L4_MABX_B.MinMax1_a = PositionFinalLimited; |
| 11246 | |
| 11247 | /* End of MinMax: '<S328>/MinMax1' */ |
| 11248 | |
| 11249 | /* Saturate: '<S328>/Saturation' */ |
| 11250 | DeltaTime = L4_MABX_B.MinMax1_a; |
| 11251 | Time56 = L4_MABX_P.Saturation_LowerSat_ph; |
| 11252 | PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_d; |
| 11253 | if (DeltaTime > PositionFinalLimited) { |
| 11254 | L4_MABX_B.Saturation_e = PositionFinalLimited; |
| 11255 | } else if (DeltaTime < Time56) { |
| 11256 | L4_MABX_B.Saturation_e = Time56; |
| 11257 | } else { |
| 11258 | L4_MABX_B.Saturation_e = DeltaTime; |
| 11259 | } |
| 11260 | |
| 11261 | /* End of Saturate: '<S328>/Saturation' */ |
| 11262 | |
| 11263 | /* Product: '<S328>/Divide' incorporates: |
| 11264 | * Constant: '<S282>/timeConstant3' |
| 11265 | */ |
| 11266 | L4_MABX_B.Divide_d = L4_MABX_P.timeConstant3_Value / L4_MABX_B.Saturation_e; |
| 11267 | |
| 11268 | /* Product: '<S328>/Product2' */ |
| 11269 | L4_MABX_B.Product2_f = L4_MABX_B.Switch_g * L4_MABX_B.Divide_d; |
| 11270 | |
| 11271 | /* Sum: '<S328>/Subtract1' incorporates: |
| 11272 | * Constant: '<S328>/Constant1' |
| 11273 | */ |
| 11274 | L4_MABX_B.Subtract1_b = L4_MABX_P.Constant1_Value_j - L4_MABX_B.Divide_d; |
| 11275 | |
| 11276 | /* UnitDelay: '<S328>/Unit_Delay2' */ |
| 11277 | L4_MABX_B.Unit_Delay2_l = L4_MABX_DW.Unit_Delay2_DSTATE_i; |
| 11278 | |
| 11279 | /* Product: '<S328>/Product1' */ |
| 11280 | L4_MABX_B.Product1_c = L4_MABX_B.Subtract1_b * L4_MABX_B.Unit_Delay2_l; |
| 11281 | |
| 11282 | /* Sum: '<S328>/Add1' */ |
| 11283 | L4_MABX_B.Add1_p = L4_MABX_B.Product2_f + L4_MABX_B.Product1_c; |
| 11284 | |
| 11285 | /* Outputs for Atomic SubSystem: '<S328>/If_Then_Else' */ |
| 11286 | |
| 11287 | /* Constant: '<S282>/zero2' */ |
| 11288 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_a3, L4_MABX_P.zero2_Value, |
| 11289 | L4_MABX_B.Add1_p, &L4_MABX_B.If_Then_Else_mk); |
| 11290 | |
| 11291 | /* End of Outputs for SubSystem: '<S328>/If_Then_Else' */ |
| 11292 | |
| 11293 | /* Signum: '<S282>/Sign' */ |
| 11294 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_pj; |
| 11295 | if (PositionFinalLimited < 0.0) { |
| 11296 | L4_MABX_B.Sign = -1.0; |
| 11297 | } else if (PositionFinalLimited > 0.0) { |
| 11298 | L4_MABX_B.Sign = 1.0; |
| 11299 | } else if (PositionFinalLimited == 0.0) { |
| 11300 | L4_MABX_B.Sign = 0.0; |
| 11301 | } else { |
| 11302 | L4_MABX_B.Sign = (rtNaN); |
| 11303 | } |
| 11304 | |
| 11305 | /* End of Signum: '<S282>/Sign' */ |
| 11306 | |
| 11307 | /* Product: '<S282>/Product' */ |
| 11308 | L4_MABX_B.Product_cf = L4_MABX_B.If_Then_Else_mk.Switch * L4_MABX_B.Sign; |
| 11309 | |
| 11310 | /* UnitDelay: '<S329>/Unit_Delay1' */ |
| 11311 | L4_MABX_B.Unit_Delay1_d = L4_MABX_DW.Unit_Delay1_DSTATE_p; |
| 11312 | |
| 11313 | /* Logic: '<S329>/Logical Operator' incorporates: |
| 11314 | * Constant: '<S282>/zero3' |
| 11315 | */ |
| 11316 | L4_MABX_B.LogicalOperator_nz = (L4_MABX_P.zero3_Value || |
| 11317 | L4_MABX_B.Unit_Delay1_d); |
| 11318 | |
| 11319 | /* MinMax: '<S329>/MinMax1' incorporates: |
| 11320 | * Constant: '<S282>/timeConstant4' |
| 11321 | * Constant: '<S282>/timeConstant5' |
| 11322 | */ |
| 11323 | DeltaTime = L4_MABX_P.timeConstant5_Value; |
| 11324 | PositionFinalLimited = L4_MABX_P.timeConstant4_Value; |
| 11325 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 11326 | PositionFinalLimited = DeltaTime; |
| 11327 | } |
| 11328 | |
| 11329 | L4_MABX_B.MinMax1_e = PositionFinalLimited; |
| 11330 | |
| 11331 | /* End of MinMax: '<S329>/MinMax1' */ |
| 11332 | |
| 11333 | /* Saturate: '<S329>/Saturation' */ |
| 11334 | DeltaTime = L4_MABX_B.MinMax1_e; |
| 11335 | Time56 = L4_MABX_P.Saturation_LowerSat_k; |
| 11336 | PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_ok; |
| 11337 | if (DeltaTime > PositionFinalLimited) { |
| 11338 | L4_MABX_B.Saturation_o = PositionFinalLimited; |
| 11339 | } else if (DeltaTime < Time56) { |
| 11340 | L4_MABX_B.Saturation_o = Time56; |
| 11341 | } else { |
| 11342 | L4_MABX_B.Saturation_o = DeltaTime; |
| 11343 | } |
| 11344 | |
| 11345 | /* End of Saturate: '<S329>/Saturation' */ |
| 11346 | |
| 11347 | /* Product: '<S329>/Divide' incorporates: |
| 11348 | * Constant: '<S282>/timeConstant5' |
| 11349 | */ |
| 11350 | L4_MABX_B.Divide_j = L4_MABX_P.timeConstant5_Value / L4_MABX_B.Saturation_o; |
| 11351 | |
| 11352 | /* Product: '<S329>/Product2' */ |
| 11353 | L4_MABX_B.Product2_nk = L4_MABX_B.SFunction1_o3_pj * L4_MABX_B.Divide_j; |
| 11354 | |
| 11355 | /* Sum: '<S329>/Subtract1' incorporates: |
| 11356 | * Constant: '<S329>/Constant1' |
| 11357 | */ |
| 11358 | L4_MABX_B.Subtract1_eh = L4_MABX_P.Constant1_Value_oi - L4_MABX_B.Divide_j; |
| 11359 | |
| 11360 | /* UnitDelay: '<S329>/Unit_Delay2' */ |
| 11361 | L4_MABX_B.Unit_Delay2_c = L4_MABX_DW.Unit_Delay2_DSTATE_p; |
| 11362 | |
| 11363 | /* Product: '<S329>/Product1' */ |
| 11364 | L4_MABX_B.Product1_cc = L4_MABX_B.Subtract1_eh * L4_MABX_B.Unit_Delay2_c; |
| 11365 | |
| 11366 | /* Sum: '<S329>/Add1' */ |
| 11367 | L4_MABX_B.Add1_f = L4_MABX_B.Product2_nk + L4_MABX_B.Product1_cc; |
| 11368 | |
| 11369 | /* Outputs for Atomic SubSystem: '<S329>/If_Then_Else' */ |
| 11370 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_nz, L4_MABX_B.SFunction1_o3_pj, |
| 11371 | L4_MABX_B.Add1_f, &L4_MABX_B.If_Then_Else_lh); |
| 11372 | |
| 11373 | /* End of Outputs for SubSystem: '<S329>/If_Then_Else' */ |
| 11374 | |
| 11375 | /* Switch: '<S282>/Switch1' */ |
| 11376 | if (L4_MABX_B.JumpNearEdge) { |
| 11377 | L4_MABX_B.Switch1_f = L4_MABX_B.If_Then_Else_lh.Switch; |
| 11378 | } else { |
| 11379 | L4_MABX_B.Switch1_f = L4_MABX_B.SFunction1_o3_pj; |
| 11380 | } |
| 11381 | |
| 11382 | /* End of Switch: '<S282>/Switch1' */ |
| 11383 | |
| 11384 | /* Sum: '<S282>/corrected Error' */ |
| 11385 | L4_MABX_B.correctedError = L4_MABX_B.Product_cf + L4_MABX_B.Switch1_f; |
| 11386 | |
| 11387 | /* RelationalOperator: '<S283>/Relational Operator' incorporates: |
| 11388 | * Constant: '<S283>/Constant' |
| 11389 | */ |
| 11390 | L4_MABX_B.RelationalOperator_l5 = (L4_MABX_B.DataTypeConversion5_e3d >= |
| 11391 | L4_MABX_P.Constant_Value_mg); |
| 11392 | |
| 11393 | /* Switch: '<S283>/Switch' incorporates: |
| 11394 | * Constant: '<S283>/Constant1' |
| 11395 | */ |
| 11396 | if (L4_MABX_B.RelationalOperator_l5) { |
| 11397 | L4_MABX_B.Switch_h = L4_MABX_B.correctedError; |
| 11398 | } else { |
| 11399 | L4_MABX_B.Switch_h = L4_MABX_P.Constant1_Value_l; |
| 11400 | } |
| 11401 | |
| 11402 | /* End of Switch: '<S283>/Switch' */ |
| 11403 | |
| 11404 | /* Outputs for Enabled SubSystem: '<S283>/Slew_at_event' incorporates: |
| 11405 | * EnablePort: '<S334>/Enable' |
| 11406 | */ |
| 11407 | /* Constant: '<S283>/enable' */ |
| 11408 | if (L4_MABX_P.enable_Value > 0.0) { |
| 11409 | if (!L4_MABX_DW.Slew_at_event_MODE_d) { |
| 11410 | /* InitializeConditions for UnitDelay: '<S336>/Unit_Delay' */ |
| 11411 | L4_MABX_DW.Unit_Delay_DSTATE_bd = L4_MABX_P.Unit_Delay_InitialCondition_ls; |
| 11412 | |
| 11413 | /* InitializeConditions for UnitDelay: '<S337>/Unit_Delay' */ |
| 11414 | L4_MABX_DW.Unit_Delay_DSTATE_jt = L4_MABX_P.Unit_Delay_InitialCondition_i0; |
| 11415 | |
| 11416 | /* InitializeConditions for UnitDelay: '<S340>/FixPt Unit Delay2' */ |
| 11417 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_j = |
| 11418 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_c; |
| 11419 | |
| 11420 | /* InitializeConditions for UnitDelay: '<S340>/FixPt Unit Delay1' */ |
| 11421 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_o = |
| 11422 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_f; |
| 11423 | |
| 11424 | /* InitializeConditions for UnitDelay: '<S335>/Unit_Delay' */ |
| 11425 | L4_MABX_DW.Unit_Delay_DSTATE_ll = L4_MABX_P.Unit_Delay_InitialCondition_ld; |
| 11426 | L4_MABX_DW.Slew_at_event_MODE_d = true; |
| 11427 | } |
| 11428 | |
| 11429 | /* UnitDelay: '<S336>/Unit_Delay' */ |
| 11430 | L4_MABX_B.Unit_Delay_o3 = L4_MABX_DW.Unit_Delay_DSTATE_bd; |
| 11431 | |
| 11432 | /* Logic: '<S336>/Logical Operator1' */ |
| 11433 | L4_MABX_B.LogicalOperator1_gw = !L4_MABX_B.Unit_Delay_o3; |
| 11434 | |
| 11435 | /* Logic: '<S336>/Logical Operator' */ |
| 11436 | L4_MABX_B.LogicalOperator_d2 = (L4_MABX_B.DataTypeConversion_l1 && |
| 11437 | L4_MABX_B.LogicalOperator1_gw); |
| 11438 | |
| 11439 | /* UnitDelay: '<S337>/Unit_Delay' */ |
| 11440 | L4_MABX_B.Unit_Delay_hj = L4_MABX_DW.Unit_Delay_DSTATE_jt; |
| 11441 | |
| 11442 | /* Logic: '<S337>/Logical Operator1' */ |
| 11443 | L4_MABX_B.LogicalOperator1_h = (L4_MABX_B.LogicalOperator_d2 || |
| 11444 | L4_MABX_B.Unit_Delay_hj); |
| 11445 | |
| 11446 | /* UnitDelay: '<S340>/FixPt Unit Delay2' */ |
| 11447 | L4_MABX_B.FixPtUnitDelay2_h = L4_MABX_DW.FixPtUnitDelay2_DSTATE_j; |
| 11448 | |
| 11449 | /* UnitDelay: '<S340>/FixPt Unit Delay1' */ |
| 11450 | L4_MABX_B.Xold_gn = L4_MABX_DW.FixPtUnitDelay1_DSTATE_o; |
| 11451 | |
| 11452 | /* Switch: '<S340>/Init' */ |
| 11453 | if (L4_MABX_B.FixPtUnitDelay2_h != 0) { |
| 11454 | L4_MABX_B.Init_jw = L4_MABX_B.Switch_h; |
| 11455 | } else { |
| 11456 | L4_MABX_B.Init_jw = L4_MABX_B.Xold_gn; |
| 11457 | } |
| 11458 | |
| 11459 | /* End of Switch: '<S340>/Init' */ |
| 11460 | |
| 11461 | /* Abs: '<S337>/Abs' incorporates: |
| 11462 | * Constant: '<S283>/Constant3' |
| 11463 | */ |
| 11464 | L4_MABX_B.Abs_a = fabs(L4_MABX_P.Constant3_Value_j); |
| 11465 | |
| 11466 | /* Product: '<S337>/Product1' incorporates: |
| 11467 | * Constant: '<S283>/Constant2' |
| 11468 | */ |
| 11469 | L4_MABX_B.Product1_i3 = L4_MABX_B.Abs_a * L4_MABX_P.Constant2_Value_p; |
| 11470 | |
| 11471 | /* Sum: '<S337>/Add1' */ |
| 11472 | L4_MABX_B.Add1_b0 = L4_MABX_B.Init_jw + L4_MABX_B.Product1_i3; |
| 11473 | |
| 11474 | /* MinMax: '<S337>/MinMax2' */ |
| 11475 | DeltaTime = L4_MABX_B.Switch_h; |
| 11476 | PositionFinalLimited = L4_MABX_B.Add1_b0; |
| 11477 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 11478 | PositionFinalLimited = DeltaTime; |
| 11479 | } |
| 11480 | |
| 11481 | L4_MABX_B.MinMax2_l = PositionFinalLimited; |
| 11482 | |
| 11483 | /* End of MinMax: '<S337>/MinMax2' */ |
| 11484 | |
| 11485 | /* Abs: '<S337>/Abs1' incorporates: |
| 11486 | * Constant: '<S283>/Constant4' |
| 11487 | */ |
| 11488 | L4_MABX_B.Abs1_e = fabs(L4_MABX_P.Constant4_Value_bq); |
| 11489 | |
| 11490 | /* Product: '<S337>/Product2' incorporates: |
| 11491 | * Constant: '<S283>/Constant2' |
| 11492 | */ |
| 11493 | L4_MABX_B.Product2_k = L4_MABX_P.Constant2_Value_p * L4_MABX_B.Abs1_e; |
| 11494 | |
| 11495 | /* Sum: '<S337>/Subtract1' */ |
| 11496 | L4_MABX_B.Subtract1_g = L4_MABX_B.Init_jw - L4_MABX_B.Product2_k; |
| 11497 | |
| 11498 | /* MinMax: '<S337>/MinMax1' */ |
| 11499 | DeltaTime = L4_MABX_B.MinMax2_l; |
| 11500 | PositionFinalLimited = L4_MABX_B.Subtract1_g; |
| 11501 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 11502 | PositionFinalLimited = DeltaTime; |
| 11503 | } |
| 11504 | |
| 11505 | L4_MABX_B.MinMax1_k = PositionFinalLimited; |
| 11506 | |
| 11507 | /* End of MinMax: '<S337>/MinMax1' */ |
| 11508 | |
| 11509 | /* Outputs for Atomic SubSystem: '<S337>/If_Then_Else' */ |
| 11510 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_h, L4_MABX_B.Switch_h, |
| 11511 | L4_MABX_B.MinMax1_k, &L4_MABX_B.If_Then_Else_n3); |
| 11512 | |
| 11513 | /* End of Outputs for SubSystem: '<S337>/If_Then_Else' */ |
| 11514 | |
| 11515 | /* Sum: '<S334>/Subtract' */ |
| 11516 | L4_MABX_B.Subtract_ij = L4_MABX_B.Switch_h - |
| 11517 | L4_MABX_B.If_Then_Else_n3.Switch; |
| 11518 | |
| 11519 | /* Abs: '<S334>/Abs' */ |
| 11520 | L4_MABX_B.Abs_eu = fabs(L4_MABX_B.Subtract_ij); |
| 11521 | |
| 11522 | /* RelationalOperator: '<S334>/Relational Operator1' incorporates: |
| 11523 | * Constant: '<S334>/Constant1' |
| 11524 | */ |
| 11525 | L4_MABX_B.RelationalOperator1_e = (L4_MABX_B.Abs_eu <= |
| 11526 | L4_MABX_P.Constant1_Value_ah); |
| 11527 | |
| 11528 | /* Logic: '<S335>/Logical Operator3' */ |
| 11529 | L4_MABX_B.LogicalOperator3_ar = !L4_MABX_B.RelationalOperator1_e; |
| 11530 | |
| 11531 | /* UnitDelay: '<S335>/Unit_Delay' */ |
| 11532 | L4_MABX_B.Unit_Delay_ig = L4_MABX_DW.Unit_Delay_DSTATE_ll; |
| 11533 | |
| 11534 | /* Logic: '<S335>/Logical Operator1' */ |
| 11535 | L4_MABX_B.LogicalOperator1_jo = (L4_MABX_B.DataTypeConversion_l1 || |
| 11536 | L4_MABX_B.Unit_Delay_ig); |
| 11537 | |
| 11538 | /* Logic: '<S335>/Logical Operator' */ |
| 11539 | L4_MABX_B.LogicalOperator_dm = (L4_MABX_B.LogicalOperator3_ar && |
| 11540 | L4_MABX_B.LogicalOperator1_jo); |
| 11541 | |
| 11542 | /* Logic: '<S335>/Logical Operator2' */ |
| 11543 | L4_MABX_B.LogicalOperator2_j = !L4_MABX_B.LogicalOperator_dm; |
| 11544 | |
| 11545 | /* RelationalOperator: '<S338>/min_relop' incorporates: |
| 11546 | * Constant: '<S283>/Constant3' |
| 11547 | * Constant: '<S338>/min_val' |
| 11548 | */ |
| 11549 | L4_MABX_B.min_relop_d = (L4_MABX_P.CheckStaticLowerBound_min_n <= |
| 11550 | L4_MABX_P.Constant3_Value_j); |
| 11551 | |
| 11552 | /* Assertion: '<S338>/Assertion' */ |
| 11553 | utAssert(L4_MABX_B.min_relop_d); |
| 11554 | } else { |
| 11555 | if (L4_MABX_DW.Slew_at_event_MODE_d) { |
| 11556 | /* Disable for Outport: '<S334>/F_Out_slewing' */ |
| 11557 | L4_MABX_B.LogicalOperator_dm = L4_MABX_P.F_Out_slewing_Y0; |
| 11558 | |
| 11559 | /* Disable for Outport: '<S334>/Out' */ |
| 11560 | L4_MABX_B.If_Then_Else_n3.Switch = L4_MABX_P.Out_Y0; |
| 11561 | L4_MABX_DW.Slew_at_event_MODE_d = false; |
| 11562 | } |
| 11563 | } |
| 11564 | |
| 11565 | /* End of Constant: '<S283>/enable' */ |
| 11566 | /* End of Outputs for SubSystem: '<S283>/Slew_at_event' */ |
| 11567 | |
| 11568 | /* Switch: '<S283>/Switch1' incorporates: |
| 11569 | * Constant: '<S283>/enableSlew' |
| 11570 | */ |
| 11571 | if (L4_MABX_P.enableSlew_Value != 0.0) { |
| 11572 | L4_MABX_B.Switch1_j = L4_MABX_B.If_Then_Else_n3.Switch; |
| 11573 | } else { |
| 11574 | L4_MABX_B.Switch1_j = L4_MABX_B.Switch_h; |
| 11575 | } |
| 11576 | |
| 11577 | /* End of Switch: '<S283>/Switch1' */ |
| 11578 | |
| 11579 | /* Gain: '<S80>/sign' */ |
| 11580 | L4_MABX_B.SteerCtrlErrRaw = L4_MABX_P.sign_Gain * L4_MABX_B.Switch1_j; |
| 11581 | |
| 11582 | /* DataTypeConversion: '<S80>/Data Type Conversion1' */ |
| 11583 | L4_MABX_B.DataTypeConversion1_e = L4_MABX_B.SteerCtrlErrRaw; |
| 11584 | |
| 11585 | /* UnitDelay: '<S285>/Unit Delay' */ |
| 11586 | L4_MABX_B.UnitDelay_fm = L4_MABX_DW.UnitDelay_DSTATE_dj; |
| 11587 | |
| 11588 | /* Switch: '<S289>/Switch1' incorporates: |
| 11589 | * Constant: '<S285>/E' |
| 11590 | * Constant: '<S285>/R' |
| 11591 | * Switch: '<S287>/Switch1' |
| 11592 | */ |
| 11593 | if (L4_MABX_P.R_Value) { |
| 11594 | /* DataTypeConversion: '<S285>/Data Type Conversion1' incorporates: |
| 11595 | * Constant: '<S285>/IV' |
| 11596 | */ |
| 11597 | L4_MABX_B.DataTypeConversion1_b1 = (real32_T)L4_MABX_P.IV_Value; |
| 11598 | L4_MABX_B.Switch1_fi = L4_MABX_B.DataTypeConversion1_b1; |
| 11599 | } else { |
| 11600 | if (L4_MABX_P.E_Value_j) { |
| 11601 | /* DataTypeConversion: '<S285>/Data Type Conversion' incorporates: |
| 11602 | * Switch: '<S287>/Switch1' |
| 11603 | */ |
| 11604 | L4_MABX_B.DataTypeConversion_ps = (real32_T) |
| 11605 | L4_MABX_B.DataTypeConversion1_e; |
| 11606 | |
| 11607 | /* Sum: '<S285>/Add3' incorporates: |
| 11608 | * Switch: '<S287>/Switch1' |
| 11609 | */ |
| 11610 | L4_MABX_B.Add3_j = L4_MABX_B.DataTypeConversion_ps - |
| 11611 | L4_MABX_B.UnitDelay_fm; |
| 11612 | |
| 11613 | /* Product: '<S285>/Product1' incorporates: |
| 11614 | * Switch: '<S287>/Switch1' |
| 11615 | */ |
| 11616 | L4_MABX_B.Product1_n2 = L4_MABX_B.Divide_nn * L4_MABX_B.Add3_j; |
| 11617 | |
| 11618 | /* Sum: '<S285>/Add' incorporates: |
| 11619 | * Switch: '<S287>/Switch1' |
| 11620 | */ |
| 11621 | L4_MABX_B.Add_f = L4_MABX_B.Product1_n2 + L4_MABX_B.UnitDelay_fm; |
| 11622 | |
| 11623 | /* Switch: '<S287>/Switch1' */ |
| 11624 | L4_MABX_B.Switch1_cw = L4_MABX_B.Add_f; |
| 11625 | } else { |
| 11626 | /* Switch: '<S287>/Switch1' */ |
| 11627 | L4_MABX_B.Switch1_cw = L4_MABX_B.UnitDelay_fm; |
| 11628 | } |
| 11629 | |
| 11630 | L4_MABX_B.Switch1_fi = L4_MABX_B.Switch1_cw; |
| 11631 | } |
| 11632 | |
| 11633 | /* End of Switch: '<S289>/Switch1' */ |
| 11634 | |
| 11635 | /* DataTypeConversion: '<S286>/Conversion' */ |
| 11636 | L4_MABX_B.Conversion = L4_MABX_B.Switch1_fi; |
| 11637 | |
| 11638 | /* Abs: '<S80>/Abs' */ |
| 11639 | L4_MABX_B.Abs_d = fabs(L4_MABX_B.Conversion); |
| 11640 | |
| 11641 | /* Lookup_n-D: '<S80>/SteeringControlPGainErrorBased' */ |
| 11642 | L4_MABX_B.SteeringControlPGainErrorBased = look1_binlxpw(L4_MABX_B.Abs_d, |
| 11643 | L4_MABX_P.SteeringControlPGainErrorBase_n, |
| 11644 | L4_MABX_P.SteeringControlPGainErrorBased_, 9U); |
| 11645 | |
| 11646 | /* DataTypeConversion: '<S80>/Data Type Conversion' */ |
| 11647 | L4_MABX_B.DataTypeConversion_ku = L4_MABX_B.SFunction1_o1_ee; |
| 11648 | |
| 11649 | /* Lookup_n-D: '<S80>/SteeringControlPGainSpeedFactor' */ |
| 11650 | L4_MABX_B.SteeringControlPGainSpeedFactor = look1_binlxpw |
| 11651 | (L4_MABX_B.DataTypeConversion_ku, L4_MABX_P.SteeringControlPGainSpeedFact_i, |
| 11652 | L4_MABX_P.SteeringControlPGainSpeedFactor, 8U); |
| 11653 | |
| 11654 | /* Product: '<S80>/Product1' */ |
| 11655 | L4_MABX_B.SteerCtrlPgain = L4_MABX_B.SteeringControlPGainErrorBased * |
| 11656 | L4_MABX_B.SteeringControlPGainSpeedFactor; |
| 11657 | |
| 11658 | /* Gain: '<S80>/Gain' */ |
| 11659 | L4_MABX_B.Gain_c = L4_MABX_P.Gain_Gain_m * L4_MABX_B.SteerCtrlPgain; |
| 11660 | |
| 11661 | /* Product: '<S296>/Product' */ |
| 11662 | L4_MABX_B.Product_d = L4_MABX_B.Conversion * L4_MABX_B.Gain_c; |
| 11663 | |
| 11664 | /* Product: '<S296>/Divide' incorporates: |
| 11665 | * Constant: '<S279>/Constant21' |
| 11666 | * Constant: '<S279>/SteeringControlIntGain' |
| 11667 | */ |
| 11668 | L4_MABX_B.Divide_ag = L4_MABX_P.Constant21_Value / |
| 11669 | L4_MABX_P.SteeringControlIntGain_Value; |
| 11670 | |
| 11671 | /* Product: '<S296>/Product1' */ |
| 11672 | L4_MABX_B.Product1_hr = L4_MABX_B.Product_d * L4_MABX_B.Divide_ag; |
| 11673 | |
| 11674 | /* UnitDelay: '<S295>/Unit Delay' */ |
| 11675 | L4_MABX_B.UnitDelay_m5 = L4_MABX_DW.UnitDelay_DSTATE_m; |
| 11676 | |
| 11677 | /* RelationalOperator: '<S295>/Relational Operator' incorporates: |
| 11678 | * Constant: '<S279>/Constant19' |
| 11679 | */ |
| 11680 | L4_MABX_B.RelationalOperator_d = (L4_MABX_B.UnitDelay_m5 >= |
| 11681 | L4_MABX_P.Constant19_Value); |
| 11682 | |
| 11683 | /* Switch: '<S295>/Switch' incorporates: |
| 11684 | * Constant: '<S295>/Constant3' |
| 11685 | */ |
| 11686 | if (L4_MABX_B.RelationalOperator_d) { |
| 11687 | L4_MABX_B.Switch_o = L4_MABX_P.Constant3_Value_pw; |
| 11688 | } else { |
| 11689 | /* RelationalOperator: '<S295>/Relational Operator1' incorporates: |
| 11690 | * Constant: '<S279>/Constant20' |
| 11691 | */ |
| 11692 | L4_MABX_B.RelationalOperator1_mf = (L4_MABX_B.UnitDelay_m5 <= |
| 11693 | L4_MABX_P.Constant20_Value); |
| 11694 | |
| 11695 | /* Switch: '<S295>/Switch1' incorporates: |
| 11696 | * Constant: '<S295>/Constant' |
| 11697 | * Constant: '<S295>/Constant2' |
| 11698 | */ |
| 11699 | if (L4_MABX_B.RelationalOperator1_mf) { |
| 11700 | L4_MABX_B.Switch1_m = L4_MABX_P.Constant2_Value_hu; |
| 11701 | } else { |
| 11702 | L4_MABX_B.Switch1_m = L4_MABX_P.Constant_Value_i; |
| 11703 | } |
| 11704 | |
| 11705 | /* End of Switch: '<S295>/Switch1' */ |
| 11706 | L4_MABX_B.Switch_o = L4_MABX_B.Switch1_m; |
| 11707 | } |
| 11708 | |
| 11709 | /* End of Switch: '<S295>/Switch' */ |
| 11710 | |
| 11711 | /* RelationalOperator: '<S298>/Relational Operator5' incorporates: |
| 11712 | * Constant: '<S298>/Constant5' |
| 11713 | */ |
| 11714 | L4_MABX_B.RelationalOperator5_f = (L4_MABX_B.Switch_o != |
| 11715 | L4_MABX_P.Constant5_Value_o); |
| 11716 | |
| 11717 | /* Signum: '<S298>/Sign1' */ |
| 11718 | PositionFinalLimited = L4_MABX_B.Product1_hr; |
| 11719 | if (PositionFinalLimited < 0.0) { |
| 11720 | L4_MABX_B.Sign1 = -1.0; |
| 11721 | } else if (PositionFinalLimited > 0.0) { |
| 11722 | L4_MABX_B.Sign1 = 1.0; |
| 11723 | } else if (PositionFinalLimited == 0.0) { |
| 11724 | L4_MABX_B.Sign1 = 0.0; |
| 11725 | } else { |
| 11726 | L4_MABX_B.Sign1 = (rtNaN); |
| 11727 | } |
| 11728 | |
| 11729 | /* End of Signum: '<S298>/Sign1' */ |
| 11730 | |
| 11731 | /* RelationalOperator: '<S298>/Relational Operator4' incorporates: |
| 11732 | * Constant: '<S298>/Constant4' |
| 11733 | */ |
| 11734 | L4_MABX_B.RelationalOperator4_la = (L4_MABX_P.Constant4_Value_j == |
| 11735 | L4_MABX_B.Sign1); |
| 11736 | |
| 11737 | /* RelationalOperator: '<S298>/Relational Operator2' incorporates: |
| 11738 | * Constant: '<S298>/Constant2' |
| 11739 | */ |
| 11740 | L4_MABX_B.RelationalOperator2_o = (L4_MABX_B.Switch_o != |
| 11741 | L4_MABX_P.Constant2_Value_g); |
| 11742 | |
| 11743 | /* Logic: '<S298>/Logical Operator1' */ |
| 11744 | L4_MABX_B.LogicalOperator1_ji = (L4_MABX_B.RelationalOperator4_la && |
| 11745 | L4_MABX_B.RelationalOperator2_o); |
| 11746 | |
| 11747 | /* RelationalOperator: '<S298>/Relational Operator1' incorporates: |
| 11748 | * Constant: '<S298>/Constant1' |
| 11749 | */ |
| 11750 | L4_MABX_B.RelationalOperator1_ie = (L4_MABX_B.Switch_o != |
| 11751 | L4_MABX_P.Constant1_Value_ly); |
| 11752 | |
| 11753 | /* RelationalOperator: '<S298>/Relational Operator3' incorporates: |
| 11754 | * Constant: '<S298>/Constant3' |
| 11755 | */ |
| 11756 | L4_MABX_B.RelationalOperator3_p = (L4_MABX_P.Constant3_Value_g == |
| 11757 | L4_MABX_B.Sign1); |
| 11758 | |
| 11759 | /* Logic: '<S298>/Logical Operator2' */ |
| 11760 | L4_MABX_B.LogicalOperator2_o = (L4_MABX_B.RelationalOperator1_ie && |
| 11761 | L4_MABX_B.RelationalOperator3_p); |
| 11762 | |
| 11763 | /* Logic: '<S298>/Logical Operator' */ |
| 11764 | L4_MABX_B.LogicalOperator_b = (L4_MABX_B.LogicalOperator1_ji || |
| 11765 | L4_MABX_B.LogicalOperator2_o); |
| 11766 | |
| 11767 | /* Logic: '<S298>/Logical Operator3' */ |
| 11768 | L4_MABX_B.LogicalOperator3_oi = (L4_MABX_B.RelationalOperator5_f && |
| 11769 | L4_MABX_B.LogicalOperator_b); |
| 11770 | |
| 11771 | /* Switch: '<S298>/Switch1' incorporates: |
| 11772 | * Constant: '<S298>/Constant' |
| 11773 | */ |
| 11774 | if (L4_MABX_B.LogicalOperator3_oi) { |
| 11775 | L4_MABX_B.Switch1_jw = L4_MABX_B.Product1_hr; |
| 11776 | } else { |
| 11777 | L4_MABX_B.Switch1_jw = L4_MABX_P.Constant_Value_o; |
| 11778 | } |
| 11779 | |
| 11780 | /* End of Switch: '<S298>/Switch1' */ |
| 11781 | |
| 11782 | /* UnitDelay: '<S296>/Unit Delay' */ |
| 11783 | L4_MABX_B.UnitDelay_oj = L4_MABX_DW.UnitDelay_DSTATE_m0; |
| 11784 | |
| 11785 | /* Sum: '<S296>/Add' */ |
| 11786 | L4_MABX_B.Add_px = L4_MABX_B.Switch1_jw + L4_MABX_B.UnitDelay_oj; |
| 11787 | |
| 11788 | /* Product: '<S296>/Divide1' incorporates: |
| 11789 | * Constant: '<S279>/Constant21' |
| 11790 | * Constant: '<S279>/SteeringControlDGain' |
| 11791 | */ |
| 11792 | L4_MABX_B.Divide1_b = L4_MABX_P.SteeringControlDGain_Value * |
| 11793 | L4_MABX_B.Product_d / L4_MABX_P.Constant21_Value; |
| 11794 | |
| 11795 | /* UnitDelay: '<S296>/Unit Delay1' */ |
| 11796 | L4_MABX_B.UnitDelay1_e = L4_MABX_DW.UnitDelay1_DSTATE_k; |
| 11797 | |
| 11798 | /* Sum: '<S296>/Add3' */ |
| 11799 | L4_MABX_B.Add3 = L4_MABX_B.Divide1_b - L4_MABX_B.UnitDelay1_e; |
| 11800 | |
| 11801 | /* Sum: '<S296>/Add1' */ |
| 11802 | L4_MABX_B.Add1_m = (L4_MABX_B.Product_d + L4_MABX_B.Add_px) + L4_MABX_B.Add3; |
| 11803 | |
| 11804 | /* RelationalOperator: '<S297>/LowerRelop1' incorporates: |
| 11805 | * Constant: '<S279>/Constant19' |
| 11806 | */ |
| 11807 | L4_MABX_B.LowerRelop1 = (L4_MABX_B.Add1_m > L4_MABX_P.Constant19_Value); |
| 11808 | |
| 11809 | /* RelationalOperator: '<S297>/UpperRelop' incorporates: |
| 11810 | * Constant: '<S279>/Constant20' |
| 11811 | */ |
| 11812 | L4_MABX_B.UpperRelop = (L4_MABX_B.Add1_m < L4_MABX_P.Constant20_Value); |
| 11813 | |
| 11814 | /* Switch: '<S297>/Switch' incorporates: |
| 11815 | * Constant: '<S279>/Constant20' |
| 11816 | */ |
| 11817 | if (L4_MABX_B.UpperRelop) { |
| 11818 | L4_MABX_B.Switch_p5 = L4_MABX_P.Constant20_Value; |
| 11819 | } else { |
| 11820 | L4_MABX_B.Switch_p5 = L4_MABX_B.Add1_m; |
| 11821 | } |
| 11822 | |
| 11823 | /* End of Switch: '<S297>/Switch' */ |
| 11824 | |
| 11825 | /* Switch: '<S297>/Switch2' incorporates: |
| 11826 | * Constant: '<S279>/Constant19' |
| 11827 | */ |
| 11828 | if (L4_MABX_B.LowerRelop1) { |
| 11829 | L4_MABX_B.Switch2_i = L4_MABX_P.Constant19_Value; |
| 11830 | } else { |
| 11831 | L4_MABX_B.Switch2_i = L4_MABX_B.Switch_p5; |
| 11832 | } |
| 11833 | |
| 11834 | /* End of Switch: '<S297>/Switch2' */ |
| 11835 | |
| 11836 | /* RateTransition: '<S80>/TmpRTBAtrad2deg1Inport1' */ |
| 11837 | if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) { |
| 11838 | L4_MABX_B.previewSteeringAngle_b = |
| 11839 | L4_MABX_DW.TmpRTBAtrad2deg1Inport1_Buffer0; |
| 11840 | } |
| 11841 | |
| 11842 | /* Gain: '<S80>/rad2deg1' */ |
| 11843 | L4_MABX_B.rad2deg1 = L4_MABX_P.rad2deg1_Gain * |
| 11844 | L4_MABX_B.previewSteeringAngle_b; |
| 11845 | |
| 11846 | /* Sum: '<S80>/Add2' incorporates: |
| 11847 | * Constant: '<S80>/steeringOffset' |
| 11848 | */ |
| 11849 | L4_MABX_B.Add2 = (L4_MABX_B.rad2deg1 + L4_MABX_B.Switch2_i) + |
| 11850 | L4_MABX_P.steeringOffset_Value; |
| 11851 | |
| 11852 | /* Lookup_n-D: '<S284>/1-D Lookup Table' */ |
| 11853 | L4_MABX_B.uDLookupTable_a = look1_binlxpw(L4_MABX_B.DataTypeConversion_ku, |
| 11854 | L4_MABX_P.uDLookupTable_bp01Data_kj, L4_MABX_P.uDLookupTable_tableData_b, 8U); |
| 11855 | |
| 11856 | /* Product: '<S284>/AdjustedStanleyGain' incorporates: |
| 11857 | * Constant: '<S284>/stanleySteeringControlGain' |
| 11858 | */ |
| 11859 | L4_MABX_B.AdjustedStanleyGain = L4_MABX_B.uDLookupTable_a * |
| 11860 | L4_MABX_P.stanleySteeringControlGain_Valu; |
| 11861 | |
| 11862 | /* Step: '<S278>/Step' */ |
| 11863 | PositionFinalLimited = L4_MABX_M->Timing.t[0]; |
| 11864 | if (PositionFinalLimited < L4_MABX_P.Step_Time) { |
| 11865 | L4_MABX_B.Step = L4_MABX_P.Step_Y0; |
| 11866 | } else { |
| 11867 | L4_MABX_B.Step = L4_MABX_P.Step_YFinal; |
| 11868 | } |
| 11869 | |
| 11870 | /* End of Step: '<S278>/Step' */ |
| 11871 | |
| 11872 | /* DataTypeConversion: '<S278>/Data Type Conversion' */ |
| 11873 | L4_MABX_B.DataTypeConversion_dn = (L4_MABX_B.Step != 0.0); |
| 11874 | |
| 11875 | /* Product: '<S290>/Divide' incorporates: |
| 11876 | * Constant: '<S278>/Constant' |
| 11877 | * Constant: '<S278>/Constant1' |
| 11878 | */ |
| 11879 | L4_MABX_B.Divide_d0 = (real32_T)(L4_MABX_P.Constant1_Value_iy / |
| 11880 | L4_MABX_P.Constant_Value_d); |
| 11881 | |
| 11882 | /* RateTransition: '<S80>/TmpRTBAtsignCurveOffsetInport1' */ |
| 11883 | if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) { |
| 11884 | L4_MABX_B.TmpRTBAtsignCurveOffsetInport1 = |
| 11885 | L4_MABX_DW.TmpRTBAtsignCurveOffsetInport1_; |
| 11886 | } |
| 11887 | |
| 11888 | /* Gain: '<S80>/signCurveOffset' */ |
| 11889 | L4_MABX_B.signCurveOffset = L4_MABX_P.signCurveOffset_Gain * |
| 11890 | L4_MABX_B.TmpRTBAtsignCurveOffsetInport1; |
| 11891 | |
| 11892 | /* UnitDelay: '<S290>/Unit Delay' */ |
| 11893 | L4_MABX_B.UnitDelay_lj = L4_MABX_DW.UnitDelay_DSTATE_m1; |
| 11894 | |
| 11895 | /* Switch: '<S294>/Switch1' incorporates: |
| 11896 | * Constant: '<S290>/E' |
| 11897 | * Switch: '<S292>/Switch1' |
| 11898 | */ |
| 11899 | if (L4_MABX_B.DataTypeConversion_dn) { |
| 11900 | /* DataTypeConversion: '<S290>/Data Type Conversion1' incorporates: |
| 11901 | * Constant: '<S290>/IV' |
| 11902 | */ |
| 11903 | L4_MABX_B.DataTypeConversion1_gp = (real32_T)L4_MABX_P.IV_Value_o; |
| 11904 | L4_MABX_B.Switch1_pb = L4_MABX_B.DataTypeConversion1_gp; |
| 11905 | } else { |
| 11906 | if (L4_MABX_P.E_Value_ct) { |
| 11907 | /* DataTypeConversion: '<S290>/Data Type Conversion' incorporates: |
| 11908 | * Switch: '<S292>/Switch1' |
| 11909 | */ |
| 11910 | L4_MABX_B.DataTypeConversion_mv = (real32_T)L4_MABX_B.signCurveOffset; |
| 11911 | |
| 11912 | /* Sum: '<S290>/Add3' incorporates: |
| 11913 | * Switch: '<S292>/Switch1' |
| 11914 | */ |
| 11915 | L4_MABX_B.Add3_p = L4_MABX_B.DataTypeConversion_mv - |
| 11916 | L4_MABX_B.UnitDelay_lj; |
| 11917 | |
| 11918 | /* Product: '<S290>/Product1' incorporates: |
| 11919 | * Switch: '<S292>/Switch1' |
| 11920 | */ |
| 11921 | L4_MABX_B.Product1_ce = L4_MABX_B.Divide_d0 * L4_MABX_B.Add3_p; |
| 11922 | |
| 11923 | /* Sum: '<S290>/Add' incorporates: |
| 11924 | * Switch: '<S292>/Switch1' |
| 11925 | */ |
| 11926 | L4_MABX_B.Add_a = L4_MABX_B.Product1_ce + L4_MABX_B.UnitDelay_lj; |
| 11927 | |
| 11928 | /* Switch: '<S292>/Switch1' */ |
| 11929 | L4_MABX_B.Switch1_aq = L4_MABX_B.Add_a; |
| 11930 | } else { |
| 11931 | /* Switch: '<S292>/Switch1' */ |
| 11932 | L4_MABX_B.Switch1_aq = L4_MABX_B.UnitDelay_lj; |
| 11933 | } |
| 11934 | |
| 11935 | L4_MABX_B.Switch1_pb = L4_MABX_B.Switch1_aq; |
| 11936 | } |
| 11937 | |
| 11938 | /* End of Switch: '<S294>/Switch1' */ |
| 11939 | |
| 11940 | /* DataTypeConversion: '<S291>/Conversion' */ |
| 11941 | L4_MABX_B.Conversion_b = L4_MABX_B.Switch1_pb; |
| 11942 | |
| 11943 | /* Gain: '<S80>/mm2m' */ |
| 11944 | L4_MABX_B.mm2m = L4_MABX_P.mm2m_Gain * L4_MABX_B.correctedError; |
| 11945 | |
| 11946 | /* Switch: '<S80>/Switch3' incorporates: |
| 11947 | * Constant: '<S80>/usePIDyForStanley' |
| 11948 | */ |
| 11949 | if (L4_MABX_P.usePIDyForStanley_Value != 0.0) { |
| 11950 | L4_MABX_B.Switch3 = L4_MABX_B.Switch2_i; |
| 11951 | } else { |
| 11952 | L4_MABX_B.Switch3 = L4_MABX_B.mm2m; |
| 11953 | } |
| 11954 | |
| 11955 | /* End of Switch: '<S80>/Switch3' */ |
| 11956 | |
| 11957 | /* Gain: '<S80>/sign3' */ |
| 11958 | L4_MABX_B.sign3 = L4_MABX_P.sign3_Gain * L4_MABX_B.Switch3; |
| 11959 | |
| 11960 | /* Sum: '<S80>/crossTrackError' */ |
| 11961 | L4_MABX_B.crossTrackError = L4_MABX_B.Conversion_b + L4_MABX_B.sign3; |
| 11962 | |
| 11963 | /* Product: '<S284>/Product' */ |
| 11964 | L4_MABX_B.Product_p = L4_MABX_B.AdjustedStanleyGain * |
| 11965 | L4_MABX_B.crossTrackError; |
| 11966 | |
| 11967 | /* Saturate: '<S284>/Saturation' */ |
| 11968 | DeltaTime = L4_MABX_B.DataTypeConversion_ku; |
| 11969 | Time56 = L4_MABX_P.Saturation_LowerSat_bq; |
| 11970 | PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_e; |
| 11971 | if (DeltaTime > PositionFinalLimited) { |
| 11972 | L4_MABX_B.Saturation_a = PositionFinalLimited; |
| 11973 | } else if (DeltaTime < Time56) { |
| 11974 | L4_MABX_B.Saturation_a = Time56; |
| 11975 | } else { |
| 11976 | L4_MABX_B.Saturation_a = DeltaTime; |
| 11977 | } |
| 11978 | |
| 11979 | /* End of Saturate: '<S284>/Saturation' */ |
| 11980 | |
| 11981 | /* Gain: '<S284>/kph2mps_' */ |
| 11982 | L4_MABX_B.kph2mps_ = L4_MABX_P.kph2mps_Gain * L4_MABX_B.Saturation_a; |
| 11983 | |
| 11984 | /* Trigonometry: '<S284>/Trigonometric Function' */ |
| 11985 | L4_MABX_B.TrigonometricFunction_p = rt_atan2d_snf(L4_MABX_B.Product_p, |
| 11986 | L4_MABX_B.kph2mps_); |
| 11987 | |
| 11988 | /* Gain: '<S80>/deg2rad1' */ |
| 11989 | L4_MABX_B.deg2rad1 = L4_MABX_P.deg2rad1_Gain * L4_MABX_B.uDLookupTable1; |
| 11990 | |
| 11991 | /* RateTransition: '<S284>/TmpRTBAtAdd2Inport2' */ |
| 11992 | if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) { |
| 11993 | L4_MABX_B.TmpRTBAtAdd2Inport2 = L4_MABX_DW.TmpRTBAtAdd2Inport2_Buffer0; |
| 11994 | } |
| 11995 | |
| 11996 | /* Sum: '<S284>/Add2' */ |
| 11997 | L4_MABX_B.Add2_g = L4_MABX_B.deg2rad1 - L4_MABX_B.TmpRTBAtAdd2Inport2; |
| 11998 | |
| 11999 | /* Gain: '<S284>/desHeadingWeight' */ |
| 12000 | L4_MABX_B.desHeadingWeight = L4_MABX_P.desHeadingWeight_Gain * |
| 12001 | L4_MABX_B.Add2_g; |
| 12002 | |
| 12003 | /* Sum: '<S284>/Add1' */ |
| 12004 | L4_MABX_B.Add1_h = L4_MABX_B.TrigonometricFunction_p + |
| 12005 | L4_MABX_B.desHeadingWeight; |
| 12006 | |
| 12007 | /* DataTypeConversion: '<S310>/Data Type Conversion' incorporates: |
| 12008 | * Constant: '<S310>/RATE_LIMITER_ENABLE_APV' |
| 12009 | */ |
| 12010 | L4_MABX_B.DataTypeConversion_l5 = (real_T)RATE_LIMITER_ENABLE_APV; |
| 12011 | |
| 12012 | /* Lookup_n-D: '<S310>/Saturation Speed Lookup' */ |
| 12013 | L4_MABX_B.SaturationSpeedLookup = look1_binlcapw |
| 12014 | (L4_MABX_B.DataTypeConversion_ku, L4_MABX_P.SaturationSpeedLookup_bp01Data, |
| 12015 | L4_MABX_P.SaturationSpeedLookup_tableData, 5U); |
| 12016 | |
| 12017 | /* Constant: '<S310>/Constant' */ |
| 12018 | Lateral_Control_Rate_Limit = Lateral_Control_Rate_Limit_APV; |
| 12019 | |
| 12020 | /* SampleTimeMath: '<S321>/sample time' |
| 12021 | * |
| 12022 | * About '<S321>/sample time': |
| 12023 | * y = K where K = ( w * Ts ) |
| 12024 | */ |
| 12025 | L4_MABX_B.sampletime = L4_MABX_P.sampletime_WtEt; |
| 12026 | |
| 12027 | /* Product: '<S321>/delta rise limit' */ |
| 12028 | L4_MABX_B.deltariselimit = Lateral_Control_Rate_Limit * L4_MABX_B.sampletime; |
| 12029 | |
| 12030 | /* SampleTimeMath: '<S308>/sample time' |
| 12031 | * |
| 12032 | * About '<S308>/sample time': |
| 12033 | * y = K where K = ( w * Ts ) |
| 12034 | */ |
| 12035 | L4_MABX_B.sampletime_c = L4_MABX_P.sampletime_WtEt_j; |
| 12036 | |
| 12037 | /* Product: '<S308>/delta rise limit' incorporates: |
| 12038 | * Constant: '<S281>/Constant7' |
| 12039 | */ |
| 12040 | L4_MABX_B.deltariselimit_c = Lateral_Control_Error_Rate_Limit * |
| 12041 | L4_MABX_B.sampletime_c; |
| 12042 | |
| 12043 | /* MATLAB Function: '<S281>/Error Calc' */ |
| 12044 | /* MATLAB Function 'STEERCTRL_10ms/SteerController/Error Calc': '<S303>:1' */ |
| 12045 | /* '<S303>:1:3' */ |
| 12046 | Lateral_Control_Heading_Error = TargetAzimuth_rad - CurrentAzimuth_rad; |
| 12047 | if (Lateral_Control_Heading_Error < -3.1415926535897931) { |
| 12048 | /* '<S303>:1:5' */ |
| 12049 | /* '<S303>:1:6' */ |
| 12050 | Lateral_Control_Heading_Error += 6.2831853071795862; |
| 12051 | } else { |
| 12052 | if (Lateral_Control_Heading_Error > 3.1415926535897931) { |
| 12053 | /* '<S303>:1:7' */ |
| 12054 | /* '<S303>:1:8' */ |
| 12055 | Lateral_Control_Heading_Error -= 6.2831853071795862; |
| 12056 | } |
| 12057 | } |
| 12058 | |
| 12059 | /* End of MATLAB Function: '<S281>/Error Calc' */ |
| 12060 | |
| 12061 | /* UnitDelay: '<S308>/Delay Input2' */ |
| 12062 | L4_MABX_B.Yk1 = L4_MABX_DW.DelayInput2_DSTATE; |
| 12063 | |
| 12064 | /* Sum: '<S308>/Difference Inputs1' */ |
| 12065 | L4_MABX_B.UkYk1 = Lateral_Control_Heading_Error - L4_MABX_B.Yk1; |
| 12066 | |
| 12067 | /* RelationalOperator: '<S317>/LowerRelop1' */ |
| 12068 | L4_MABX_B.LowerRelop1_h = (L4_MABX_B.UkYk1 > L4_MABX_B.deltariselimit_c); |
| 12069 | |
| 12070 | /* Product: '<S308>/delta fall limit' incorporates: |
| 12071 | * Constant: '<S281>/Constant8' |
| 12072 | */ |
| 12073 | PositionFinalLimited = -Lateral_Control_Error_Rate_Limit; |
| 12074 | L4_MABX_B.deltafalllimit = PositionFinalLimited * L4_MABX_B.sampletime_c; |
| 12075 | |
| 12076 | /* RelationalOperator: '<S317>/UpperRelop' */ |
| 12077 | L4_MABX_B.UpperRelop_f = (L4_MABX_B.UkYk1 < L4_MABX_B.deltafalllimit); |
| 12078 | |
| 12079 | /* Switch: '<S317>/Switch' */ |
| 12080 | if (L4_MABX_B.UpperRelop_f) { |
| 12081 | L4_MABX_B.Switch_i = L4_MABX_B.deltafalllimit; |
| 12082 | } else { |
| 12083 | L4_MABX_B.Switch_i = L4_MABX_B.UkYk1; |
| 12084 | } |
| 12085 | |
| 12086 | /* End of Switch: '<S317>/Switch' */ |
| 12087 | |
| 12088 | /* Switch: '<S317>/Switch2' */ |
| 12089 | if (L4_MABX_B.LowerRelop1_h) { |
| 12090 | L4_MABX_B.Switch2_f = L4_MABX_B.deltariselimit_c; |
| 12091 | } else { |
| 12092 | L4_MABX_B.Switch2_f = L4_MABX_B.Switch_i; |
| 12093 | } |
| 12094 | |
| 12095 | /* End of Switch: '<S317>/Switch2' */ |
| 12096 | |
| 12097 | /* Sum: '<S308>/Difference Inputs2' */ |
| 12098 | L4_MABX_B.DifferenceInputs2 = L4_MABX_B.Switch2_f + L4_MABX_B.Yk1; |
| 12099 | |
| 12100 | /* RelationalOperator: '<S304>/Relational Operator1' incorporates: |
| 12101 | * Constant: '<S281>/Constant' |
| 12102 | */ |
| 12103 | L4_MABX_B.RelationalOperator1_p = (L4_MABX_B.DifferenceInputs2 >= |
| 12104 | Lateral_Control_Error_Limit); |
| 12105 | |
| 12106 | /* RelationalOperator: '<S304>/Relational Operator' incorporates: |
| 12107 | * Constant: '<S281>/Constant1' |
| 12108 | */ |
| 12109 | PositionFinalLimited = -Lateral_Control_Error_Limit; |
| 12110 | L4_MABX_B.RelationalOperator_h = (L4_MABX_B.DifferenceInputs2 <= |
| 12111 | PositionFinalLimited); |
| 12112 | |
| 12113 | /* Outputs for Atomic SubSystem: '<S304>/If_Then_Else1' */ |
| 12114 | /* Constant: '<S281>/Constant1' */ |
| 12115 | PositionFinalLimited = -Lateral_Control_Error_Limit; |
| 12116 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_h, PositionFinalLimited, |
| 12117 | L4_MABX_B.DifferenceInputs2, &L4_MABX_B.If_Then_Else1_km); |
| 12118 | |
| 12119 | /* End of Outputs for SubSystem: '<S304>/If_Then_Else1' */ |
| 12120 | |
| 12121 | /* Outputs for Atomic SubSystem: '<S304>/If_Then_Else' */ |
| 12122 | |
| 12123 | /* Constant: '<S281>/Constant' */ |
| 12124 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_p, |
| 12125 | Lateral_Control_Error_Limit, |
| 12126 | L4_MABX_B.If_Then_Else1_km.Switch, |
| 12127 | &L4_MABX_B.If_Then_Else_pn); |
| 12128 | |
| 12129 | /* End of Outputs for SubSystem: '<S304>/If_Then_Else' */ |
| 12130 | |
| 12131 | /* Outputs for Atomic SubSystem: '<S281>/If_Then_Else1' */ |
| 12132 | |
| 12133 | /* Constant: '<S281>/Zero' */ |
| 12134 | L4_MABX_If_Then_Else_g(AutonomousEnabled, L4_MABX_B.If_Then_Else_pn.Switch, |
| 12135 | L4_MABX_P.Zero_Value, &L4_MABX_B.If_Then_Else1_m); |
| 12136 | |
| 12137 | /* End of Outputs for SubSystem: '<S281>/If_Then_Else1' */ |
| 12138 | |
| 12139 | /* Gain: '<S307>/Proportional Gain' */ |
| 12140 | L4_MABX_B.ProportionalGain = Lateral_Control_P * |
| 12141 | L4_MABX_B.If_Then_Else1_m.Switch; |
| 12142 | |
| 12143 | /* DiscreteIntegrator: '<S307>/Integrator' */ |
| 12144 | if (AutonomousEnabled && (L4_MABX_DW.Integrator_PrevResetState <= 0)) { |
| 12145 | L4_MABX_DW.Integrator_DSTATE = L4_MABX_P.Integrator_IC; |
| 12146 | } |
| 12147 | |
| 12148 | L4_MABX_B.Integrator = L4_MABX_DW.Integrator_DSTATE; |
| 12149 | |
| 12150 | /* End of DiscreteIntegrator: '<S307>/Integrator' */ |
| 12151 | |
| 12152 | /* Gain: '<S307>/Derivative Gain' */ |
| 12153 | L4_MABX_B.DerivativeGain = Lateral_Control_D * |
| 12154 | L4_MABX_B.If_Then_Else1_m.Switch; |
| 12155 | |
| 12156 | /* DiscreteIntegrator: '<S307>/Filter' */ |
| 12157 | if (AutonomousEnabled && (L4_MABX_DW.Filter_PrevResetState <= 0)) { |
| 12158 | L4_MABX_DW.Filter_DSTATE = L4_MABX_P.Filter_IC; |
| 12159 | } |
| 12160 | |
| 12161 | L4_MABX_B.Filter = L4_MABX_DW.Filter_DSTATE; |
| 12162 | |
| 12163 | /* End of DiscreteIntegrator: '<S307>/Filter' */ |
| 12164 | |
| 12165 | /* Sum: '<S307>/SumD' */ |
| 12166 | L4_MABX_B.SumD = L4_MABX_B.DerivativeGain - L4_MABX_B.Filter; |
| 12167 | |
| 12168 | /* Gain: '<S307>/Filter Coefficient' */ |
| 12169 | L4_MABX_B.FilterCoefficient = L4_MABX_P.PIDController_N * L4_MABX_B.SumD; |
| 12170 | |
| 12171 | /* Sum: '<S307>/Sum' */ |
| 12172 | L4_MABX_B.Sum_c = (L4_MABX_B.ProportionalGain + L4_MABX_B.Integrator) + |
| 12173 | L4_MABX_B.FilterCoefficient; |
| 12174 | |
| 12175 | /* Saturate: '<S307>/Saturate' */ |
| 12176 | DeltaTime = L4_MABX_B.Sum_c; |
| 12177 | Time56 = L4_MABX_P.PIDController_LowerSaturationLi; |
| 12178 | PositionFinalLimited = L4_MABX_P.PIDController_UpperSaturationLi; |
| 12179 | if (DeltaTime > PositionFinalLimited) { |
| 12180 | L4_MABX_B.Saturate = PositionFinalLimited; |
| 12181 | } else if (DeltaTime < Time56) { |
| 12182 | L4_MABX_B.Saturate = Time56; |
| 12183 | } else { |
| 12184 | L4_MABX_B.Saturate = DeltaTime; |
| 12185 | } |
| 12186 | |
| 12187 | /* End of Saturate: '<S307>/Saturate' */ |
| 12188 | |
| 12189 | /* UnitDelay: '<S311>/Delay Input' */ |
| 12190 | L4_MABX_B.Uk1_m = L4_MABX_DW.DelayInput_DSTATE; |
| 12191 | |
| 12192 | /* Gain: '<S311>/GainZero' */ |
| 12193 | L4_MABX_B.ZeroUk1 = Lateral_Control_Zero * L4_MABX_B.Uk1_m; |
| 12194 | |
| 12195 | /* UnitDelay: '<S311>/Delay Output' */ |
| 12196 | L4_MABX_B.Yk1_p = L4_MABX_DW.DelayOutput_DSTATE; |
| 12197 | |
| 12198 | /* Gain: '<S311>/GainPole' */ |
| 12199 | L4_MABX_B.PoleYk1 = Lateral_Control_Pole * L4_MABX_B.Yk1_p; |
| 12200 | |
| 12201 | /* Sum: '<S311>/Sum' */ |
| 12202 | L4_MABX_B.PoleYk1UkZeroUk1 = (L4_MABX_B.Saturate - L4_MABX_B.ZeroUk1) + |
| 12203 | L4_MABX_B.PoleYk1; |
| 12204 | |
| 12205 | /* DataTypeConversion: '<S311>/Downcast' */ |
| 12206 | L4_MABX_B.Downcast = L4_MABX_B.PoleYk1UkZeroUk1; |
| 12207 | |
| 12208 | /* Sum: '<S281>/Subtract' incorporates: |
| 12209 | * Constant: '<S281>/Constant6' |
| 12210 | */ |
| 12211 | L4_MABX_B.Subtract_c = ReAX_ActualHandwheelPos - REAX_OFFSET_APV; |
| 12212 | |
| 12213 | /* Lookup_n-D: '<S281>/1-D Lookup Table' */ |
| 12214 | L4_MABX_B.uDLookupTable_j = look1_binlxpw(L4_MABX_B.Subtract_c, |
| 12215 | L4_MABX_P.uDLookupTable_bp01Data_d, L4_MABX_P.uDLookupTable_tableData_d, 71U); |
| 12216 | |
| 12217 | /* Gain: '<S281>/deg2rad' */ |
| 12218 | L4_MABX_B.deg2rad = L4_MABX_P.deg2rad_Gain_l * L4_MABX_B.uDLookupTable_j; |
| 12219 | |
| 12220 | /* Gain: '<S281>/invert' */ |
| 12221 | L4_MABX_B.invert = L4_MABX_P.invert_Gain_i * L4_MABX_B.deg2rad; |
| 12222 | |
| 12223 | /* Gain: '<S281>/PGain' */ |
| 12224 | L4_MABX_B.PGain = Lateral_Control_P * L4_MABX_B.If_Then_Else_pn.Switch; |
| 12225 | |
| 12226 | /* SampleTimeMath: '<S309>/sample time' |
| 12227 | * |
| 12228 | * About '<S309>/sample time': |
| 12229 | * y = K where K = ( w * Ts ) |
| 12230 | */ |
| 12231 | L4_MABX_B.sampletime_a = L4_MABX_P.sampletime_WtEt_p; |
| 12232 | |
| 12233 | /* Product: '<S309>/delta rise limit' incorporates: |
| 12234 | * Constant: '<S281>/Constant9' |
| 12235 | */ |
| 12236 | L4_MABX_B.deltariselimit_o = Lateral_Control_Error_Rate_Limit * |
| 12237 | L4_MABX_B.sampletime_a; |
| 12238 | |
| 12239 | /* Sum: '<S281>/Sum' incorporates: |
| 12240 | * Constant: '<S281>/YAW_RATE_OFFSET_APV' |
| 12241 | */ |
| 12242 | L4_MABX_B.Sum_ly = YawRate + YAW_RATE_OFFSET_APV; |
| 12243 | |
| 12244 | /* RelationalOperator: '<S312>/Relational Operator1' incorporates: |
| 12245 | * Constant: '<S281>/Constant2' |
| 12246 | */ |
| 12247 | L4_MABX_B.RelationalOperator1_f = (L4_MABX_B.Sum_ly >= |
| 12248 | Lateral_Control_YawRate_Limit); |
| 12249 | |
| 12250 | /* RelationalOperator: '<S312>/Relational Operator' incorporates: |
| 12251 | * Constant: '<S281>/Constant4' |
| 12252 | */ |
| 12253 | PositionFinalLimited = -Lateral_Control_YawRate_Limit; |
| 12254 | L4_MABX_B.RelationalOperator_l4 = (L4_MABX_B.Sum_ly <= PositionFinalLimited); |
| 12255 | |
| 12256 | /* Outputs for Atomic SubSystem: '<S312>/If_Then_Else1' */ |
| 12257 | /* Constant: '<S281>/Constant4' */ |
| 12258 | PositionFinalLimited = -Lateral_Control_YawRate_Limit; |
| 12259 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_l4, PositionFinalLimited, |
| 12260 | L4_MABX_B.Sum_ly, &L4_MABX_B.If_Then_Else1_o); |
| 12261 | |
| 12262 | /* End of Outputs for SubSystem: '<S312>/If_Then_Else1' */ |
| 12263 | |
| 12264 | /* Outputs for Atomic SubSystem: '<S312>/If_Then_Else' */ |
| 12265 | |
| 12266 | /* Constant: '<S281>/Constant2' */ |
| 12267 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_f, |
| 12268 | Lateral_Control_YawRate_Limit, |
| 12269 | L4_MABX_B.If_Then_Else1_o.Switch, |
| 12270 | &L4_MABX_B.If_Then_Else_m0); |
| 12271 | |
| 12272 | /* End of Outputs for SubSystem: '<S312>/If_Then_Else' */ |
| 12273 | |
| 12274 | /* Gain: '<S281>/RateFeedbackGain' */ |
| 12275 | L4_MABX_B.RateFeedbackGain = Yaw_Rate_FF_Gain * |
| 12276 | L4_MABX_B.If_Then_Else_m0.Switch; |
| 12277 | |
| 12278 | /* RelationalOperator: '<S302>/Relational Operator1' incorporates: |
| 12279 | * Constant: '<S281>/Constant3' |
| 12280 | */ |
| 12281 | L4_MABX_B.RelationalOperator1_gr = (Curvature >= |
| 12282 | Lateral_Control_Curvature_Limit); |
| 12283 | |
| 12284 | /* RelationalOperator: '<S302>/Relational Operator' incorporates: |
| 12285 | * Constant: '<S281>/Constant5' |
| 12286 | */ |
| 12287 | PositionFinalLimited = -Lateral_Control_Curvature_Limit; |
| 12288 | L4_MABX_B.RelationalOperator_o = (Curvature <= PositionFinalLimited); |
| 12289 | |
| 12290 | /* Outputs for Atomic SubSystem: '<S302>/If_Then_Else1' */ |
| 12291 | /* Constant: '<S281>/Constant5' */ |
| 12292 | PositionFinalLimited = -Lateral_Control_Curvature_Limit; |
| 12293 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_o, PositionFinalLimited, |
| 12294 | Curvature, &L4_MABX_B.If_Then_Else1_d); |
| 12295 | |
| 12296 | /* End of Outputs for SubSystem: '<S302>/If_Then_Else1' */ |
| 12297 | |
| 12298 | /* Outputs for Atomic SubSystem: '<S302>/If_Then_Else' */ |
| 12299 | |
| 12300 | /* Constant: '<S281>/Constant3' */ |
| 12301 | L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_gr, |
| 12302 | Lateral_Control_Curvature_Limit, |
| 12303 | L4_MABX_B.If_Then_Else1_d.Switch, |
| 12304 | &L4_MABX_B.If_Then_Else_pe); |
| 12305 | |
| 12306 | /* End of Outputs for SubSystem: '<S302>/If_Then_Else' */ |
| 12307 | |
| 12308 | /* Gain: '<S281>/FeedforwardGain' */ |
| 12309 | L4_MABX_B.FeedforwardGain = Curvature_FF_Gain * |
| 12310 | L4_MABX_B.If_Then_Else_pe.Switch; |
| 12311 | |
| 12312 | /* Gain: '<S281>/UndersteerCorrection' */ |
| 12313 | L4_MABX_B.UndersteerCorrection = UndersteerCorection * |
| 12314 | L4_MABX_B.FeedforwardGain; |
| 12315 | |
| 12316 | /* Sum: '<S281>/Sum2' */ |
| 12317 | L4_MABX_B.Sum2 = L4_MABX_B.UndersteerCorrection - L4_MABX_B.RateFeedbackGain; |
| 12318 | |
| 12319 | /* UnitDelay: '<S309>/Delay Input2' */ |
| 12320 | L4_MABX_B.Yk1_o = L4_MABX_DW.DelayInput2_DSTATE_a; |
| 12321 | |
| 12322 | /* Sum: '<S309>/Difference Inputs1' */ |
| 12323 | L4_MABX_B.UkYk1_n = L4_MABX_B.Sum2 - L4_MABX_B.Yk1_o; |
| 12324 | |
| 12325 | /* RelationalOperator: '<S318>/LowerRelop1' */ |
| 12326 | L4_MABX_B.LowerRelop1_o = (L4_MABX_B.UkYk1_n > L4_MABX_B.deltariselimit_o); |
| 12327 | |
| 12328 | /* Product: '<S309>/delta fall limit' incorporates: |
| 12329 | * Constant: '<S281>/Constant10' |
| 12330 | */ |
| 12331 | PositionFinalLimited = -Lateral_Control_Error_Rate_Limit; |
| 12332 | L4_MABX_B.deltafalllimit_o = PositionFinalLimited * L4_MABX_B.sampletime_a; |
| 12333 | |
| 12334 | /* RelationalOperator: '<S318>/UpperRelop' */ |
| 12335 | L4_MABX_B.UpperRelop_o = (L4_MABX_B.UkYk1_n < L4_MABX_B.deltafalllimit_o); |
| 12336 | |
| 12337 | /* Switch: '<S318>/Switch' */ |
| 12338 | if (L4_MABX_B.UpperRelop_o) { |
| 12339 | L4_MABX_B.Switch_ea = L4_MABX_B.deltafalllimit_o; |
| 12340 | } else { |
| 12341 | L4_MABX_B.Switch_ea = L4_MABX_B.UkYk1_n; |
| 12342 | } |
| 12343 | |
| 12344 | /* End of Switch: '<S318>/Switch' */ |
| 12345 | |
| 12346 | /* Switch: '<S318>/Switch2' */ |
| 12347 | if (L4_MABX_B.LowerRelop1_o) { |
| 12348 | L4_MABX_B.Switch2_e = L4_MABX_B.deltariselimit_o; |
| 12349 | } else { |
| 12350 | L4_MABX_B.Switch2_e = L4_MABX_B.Switch_ea; |
| 12351 | } |
| 12352 | |
| 12353 | /* End of Switch: '<S318>/Switch2' */ |
| 12354 | |
| 12355 | /* Sum: '<S309>/Difference Inputs2' */ |
| 12356 | L4_MABX_B.DifferenceInputs2_a = L4_MABX_B.Switch2_e + L4_MABX_B.Yk1_o; |
| 12357 | |
| 12358 | /* Sum: '<S281>/Sum3' */ |
| 12359 | L4_MABX_B.Sum3 = (L4_MABX_B.invert - L4_MABX_B.PGain) - |
| 12360 | L4_MABX_B.DifferenceInputs2_a; |
| 12361 | |
| 12362 | /* DiscreteIntegrator: '<S301>/Discrete-Time Integrator' */ |
| 12363 | if (L4_MABX_DW.DiscreteTimeIntegrator_IC_LOADI != 0) { |
| 12364 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE = L4_MABX_B.Sum3; |
| 12365 | } |
| 12366 | |
| 12367 | if (AutonomousEnabled && (L4_MABX_DW.DiscreteTimeIntegrator_PrevRese <= 0)) { |
| 12368 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE = L4_MABX_B.Sum3; |
| 12369 | } |
| 12370 | |
| 12371 | L4_MABX_B.DiscreteTimeIntegrator = L4_MABX_DW.DiscreteTimeIntegrator_DSTATE; |
| 12372 | |
| 12373 | /* End of DiscreteIntegrator: '<S301>/Discrete-Time Integrator' */ |
| 12374 | |
| 12375 | /* Sum: '<S281>/Sum4' */ |
| 12376 | L4_MABX_B.Sum4 = L4_MABX_B.Downcast + L4_MABX_B.DiscreteTimeIntegrator; |
| 12377 | |
| 12378 | /* Sum: '<S281>/Sum1' */ |
| 12379 | Lateral_Control_Output = L4_MABX_B.Sum4 + L4_MABX_B.DifferenceInputs2_a; |
| 12380 | |
| 12381 | /* UnitDelay: '<S321>/Delay Input2' */ |
| 12382 | L4_MABX_B.Yk1_pm = L4_MABX_DW.DelayInput2_DSTATE_l; |
| 12383 | |
| 12384 | /* Sum: '<S321>/Difference Inputs1' */ |
| 12385 | L4_MABX_B.UkYk1_f = Lateral_Control_Output - L4_MABX_B.Yk1_pm; |
| 12386 | |
| 12387 | /* RelationalOperator: '<S323>/LowerRelop1' */ |
| 12388 | L4_MABX_B.LowerRelop1_l = (L4_MABX_B.UkYk1_f > L4_MABX_B.deltariselimit); |
| 12389 | |
| 12390 | /* Gain: '<S310>/Gain3' */ |
| 12391 | L4_MABX_B.RateLimitLower = L4_MABX_P.Gain3_Gain_p * Lateral_Control_Rate_Limit; |
| 12392 | |
| 12393 | /* Product: '<S321>/delta fall limit' */ |
| 12394 | L4_MABX_B.deltafalllimit_n = L4_MABX_B.RateLimitLower * L4_MABX_B.sampletime; |
| 12395 | |
| 12396 | /* RelationalOperator: '<S323>/UpperRelop' */ |
| 12397 | L4_MABX_B.UpperRelop_k = (L4_MABX_B.UkYk1_f < L4_MABX_B.deltafalllimit_n); |
| 12398 | |
| 12399 | /* Switch: '<S323>/Switch' */ |
| 12400 | if (L4_MABX_B.UpperRelop_k) { |
| 12401 | L4_MABX_B.Switch_f = L4_MABX_B.deltafalllimit_n; |
| 12402 | } else { |
| 12403 | L4_MABX_B.Switch_f = L4_MABX_B.UkYk1_f; |
| 12404 | } |
| 12405 | |
| 12406 | /* End of Switch: '<S323>/Switch' */ |
| 12407 | |
| 12408 | /* Switch: '<S323>/Switch2' */ |
| 12409 | if (L4_MABX_B.LowerRelop1_l) { |
| 12410 | L4_MABX_B.Switch2_fa = L4_MABX_B.deltariselimit; |
| 12411 | } else { |
| 12412 | L4_MABX_B.Switch2_fa = L4_MABX_B.Switch_f; |
| 12413 | } |
| 12414 | |
| 12415 | /* End of Switch: '<S323>/Switch2' */ |
| 12416 | |
| 12417 | /* Sum: '<S321>/Difference Inputs2' */ |
| 12418 | L4_MABX_B.DifferenceInputs2_m = L4_MABX_B.Switch2_fa + L4_MABX_B.Yk1_pm; |
| 12419 | |
| 12420 | /* RelationalOperator: '<S322>/LowerRelop1' */ |
| 12421 | L4_MABX_B.LowerRelop1_e = (L4_MABX_B.DifferenceInputs2_m > |
| 12422 | L4_MABX_B.SaturationSpeedLookup); |
| 12423 | |
| 12424 | /* Gain: '<S310>/Gain1' */ |
| 12425 | L4_MABX_B.Gain1_f = L4_MABX_P.Gain1_Gain_p * L4_MABX_B.SaturationSpeedLookup; |
| 12426 | |
| 12427 | /* RelationalOperator: '<S322>/UpperRelop' */ |
| 12428 | L4_MABX_B.UpperRelop_fl = (L4_MABX_B.DifferenceInputs2_m < L4_MABX_B.Gain1_f); |
| 12429 | |
| 12430 | /* Switch: '<S322>/Switch' */ |
| 12431 | if (L4_MABX_B.UpperRelop_fl) { |
| 12432 | L4_MABX_B.Switch_hx = L4_MABX_B.Gain1_f; |
| 12433 | } else { |
| 12434 | L4_MABX_B.Switch_hx = L4_MABX_B.DifferenceInputs2_m; |
| 12435 | } |
| 12436 | |
| 12437 | /* End of Switch: '<S322>/Switch' */ |
| 12438 | |
| 12439 | /* Switch: '<S322>/Switch2' */ |
| 12440 | if (L4_MABX_B.LowerRelop1_e) { |
| 12441 | L4_MABX_B.Switch2_k = L4_MABX_B.SaturationSpeedLookup; |
| 12442 | } else { |
| 12443 | L4_MABX_B.Switch2_k = L4_MABX_B.Switch_hx; |
| 12444 | } |
| 12445 | |
| 12446 | /* End of Switch: '<S322>/Switch2' */ |
| 12447 | |
| 12448 | /* Outputs for Atomic SubSystem: '<S310>/If_Then_Else' */ |
| 12449 | L4_MABX_If_Then_Else_c(L4_MABX_B.DataTypeConversion_l5, L4_MABX_B.Switch2_k, |
| 12450 | Lateral_Control_Output, &L4_MABX_B.If_Then_Else_c); |
| 12451 | |
| 12452 | /* End of Outputs for SubSystem: '<S310>/If_Then_Else' */ |
| 12453 | |
| 12454 | /* SignalConversion: '<S310>/TmpSignal ConversionAtIf_Then_ElseOutport1' */ |
| 12455 | Lateral_Control_Rate_Limiter_Output = L4_MABX_B.If_Then_Else_c.Switch; |
| 12456 | |
| 12457 | /* MATLAB Function: '<S280>/Error Calc' */ |
| 12458 | /* MATLAB Function 'STEERCTRL_10ms/StanleyController/Error Calc': '<S299>:1' */ |
| 12459 | /* '<S299>:1:3' */ |
| 12460 | L4_MABX_B.error = TargetAzimuth_rad - CurrentAzimuth_rad; |
| 12461 | if (L4_MABX_B.error < -3.1415926535897931) { |
| 12462 | /* '<S299>:1:5' */ |
| 12463 | /* '<S299>:1:6' */ |
| 12464 | L4_MABX_B.error += 6.2831853071795862; |
| 12465 | } else { |
| 12466 | if (L4_MABX_B.error > 3.1415926535897931) { |
| 12467 | /* '<S299>:1:7' */ |
| 12468 | /* '<S299>:1:8' */ |
| 12469 | L4_MABX_B.error -= 6.2831853071795862; |
| 12470 | } |
| 12471 | } |
| 12472 | |
| 12473 | /* End of MATLAB Function: '<S280>/Error Calc' */ |
| 12474 | |
| 12475 | /* MultiPortSwitch: '<S80>/Multiport Switch2' incorporates: |
| 12476 | * Constant: '<S80>/LAT_STEER_SRC_SELECTOR_APV' |
| 12477 | */ |
| 12478 | if (LAT_STEER_SRC_SELECTOR_APV == ENUM_LAT_STEER_SOURCE_T_PIC_HARIS) { |
| 12479 | /* Outputs for Atomic SubSystem: '<S281>/If_Then_Else' */ |
| 12480 | L4_MABX_If_Then_Else_g(AutonomousEnabled, |
| 12481 | Lateral_Control_Rate_Limiter_Output, L4_MABX_B.invert, |
| 12482 | &L4_MABX_B.If_Then_Else_m1); |
| 12483 | |
| 12484 | /* End of Outputs for SubSystem: '<S281>/If_Then_Else' */ |
| 12485 | L4_MABX_B.MultiportSwitch2 = L4_MABX_B.If_Then_Else_m1.Switch; |
| 12486 | } else { |
| 12487 | /* Saturate: '<S280>/Speed Saturation' */ |
| 12488 | DeltaTime = L4_MABX_B.DataTypeConversion_ku; |
| 12489 | Time56 = L4_MABX_P.SpeedSaturation_LowerSat; |
| 12490 | PositionFinalLimited = L4_MABX_P.SpeedSaturation_UpperSat; |
| 12491 | if (DeltaTime > PositionFinalLimited) { |
| 12492 | L4_MABX_B.SpeedSaturation = PositionFinalLimited; |
| 12493 | } else if (DeltaTime < Time56) { |
| 12494 | L4_MABX_B.SpeedSaturation = Time56; |
| 12495 | } else { |
| 12496 | L4_MABX_B.SpeedSaturation = DeltaTime; |
| 12497 | } |
| 12498 | |
| 12499 | /* End of Saturate: '<S280>/Speed Saturation' */ |
| 12500 | |
| 12501 | /* Gain: '<S280>/km//h to m//s' */ |
| 12502 | L4_MABX_B.kmhtoms = L4_MABX_P.kmhtoms_Gain * L4_MABX_B.SpeedSaturation; |
| 12503 | |
| 12504 | /* Product: '<S280>/Product' incorporates: |
| 12505 | * Constant: '<S280>/StanleySteeringControlGain' |
| 12506 | */ |
| 12507 | L4_MABX_B.Product_n = STANLEY_GAIN_APV * CrosstrackError; |
| 12508 | |
| 12509 | /* Trigonometry: '<S280>/Trigonometric Function' */ |
| 12510 | L4_MABX_B.TrigonometricFunction_l = rt_atan2d_snf(L4_MABX_B.Product_n, |
| 12511 | L4_MABX_B.kmhtoms); |
| 12512 | |
| 12513 | /* Saturate: '<S280>/Error Saturation' */ |
| 12514 | DeltaTime = L4_MABX_B.error; |
| 12515 | Time56 = L4_MABX_P.ErrorSaturation_LowerSat; |
| 12516 | PositionFinalLimited = L4_MABX_P.ErrorSaturation_UpperSat; |
| 12517 | if (DeltaTime > PositionFinalLimited) { |
| 12518 | L4_MABX_B.ErrorSaturation = PositionFinalLimited; |
| 12519 | } else if (DeltaTime < Time56) { |
| 12520 | L4_MABX_B.ErrorSaturation = Time56; |
| 12521 | } else { |
| 12522 | L4_MABX_B.ErrorSaturation = DeltaTime; |
| 12523 | } |
| 12524 | |
| 12525 | /* End of Saturate: '<S280>/Error Saturation' */ |
| 12526 | |
| 12527 | /* Sum: '<S280>/Sum1' */ |
| 12528 | L4_MABX_B.Sum1 = L4_MABX_B.ErrorSaturation + |
| 12529 | L4_MABX_B.TrigonometricFunction_l; |
| 12530 | |
| 12531 | /* Sum: '<S280>/Subtract' incorporates: |
| 12532 | * Constant: '<S280>/ReAX Offset' |
| 12533 | */ |
| 12534 | L4_MABX_B.Subtract_ej = ReAX_ActualHandwheelPos - REAX_OFFSET_APV; |
| 12535 | |
| 12536 | /* Lookup_n-D: '<S280>/1-D Lookup Table' */ |
| 12537 | L4_MABX_B.uDLookupTable_h = look1_binlxpw(L4_MABX_B.Subtract_ej, |
| 12538 | L4_MABX_P.uDLookupTable_bp01Data_k, L4_MABX_P.uDLookupTable_tableData_k, |
| 12539 | 71U); |
| 12540 | |
| 12541 | /* Gain: '<S280>/deg2rad' */ |
| 12542 | L4_MABX_B.deg2rad_o = L4_MABX_P.deg2rad_Gain_n * L4_MABX_B.uDLookupTable_h; |
| 12543 | |
| 12544 | /* Gain: '<S280>/invert' */ |
| 12545 | L4_MABX_B.invert_d = L4_MABX_P.invert_Gain * L4_MABX_B.deg2rad_o; |
| 12546 | |
| 12547 | /* Outputs for Atomic SubSystem: '<S280>/If_Then_Else' */ |
| 12548 | L4_MABX_If_Then_Else_g(AutonomousEnabled, L4_MABX_B.Sum1, L4_MABX_B.invert_d, |
| 12549 | &L4_MABX_B.If_Then_Else_nh); |
| 12550 | |
| 12551 | /* End of Outputs for SubSystem: '<S280>/If_Then_Else' */ |
| 12552 | L4_MABX_B.MultiportSwitch2 = L4_MABX_B.If_Then_Else_nh.Switch; |
| 12553 | } |
| 12554 | |
| 12555 | /* End of MultiPortSwitch: '<S80>/Multiport Switch2' */ |
| 12556 | |
| 12557 | /* DataTypeConversion: '<S80>/Data Type Conversion6' */ |
| 12558 | L4_MABX_B.DataTypeConversion6_pa = L4_MABX_B.MultiportSwitch2; |
| 12559 | |
| 12560 | /* Gain: '<S80>/rad2deg' */ |
| 12561 | L4_MABX_B.rad2deg = L4_MABX_P.rad2deg_Gain * L4_MABX_B.DataTypeConversion6_pa; |
| 12562 | |
| 12563 | /* Gain: '<S80>/sign flip' */ |
| 12564 | SteerCommandDeg = L4_MABX_P.signflip_Gain * L4_MABX_B.rad2deg; |
| 12565 | |
| 12566 | /* MultiPortSwitch: '<S80>/Multiport Switch1' incorporates: |
| 12567 | * Constant: '<S80>/LONG_SPEED_SRC_SELECTOR_APV' |
| 12568 | * Constant: '<S80>/SteeringOverrideVal1' |
| 12569 | */ |
| 12570 | switch (LONG_SPEED_SRC_SELECTOR_APV) { |
| 12571 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH: |
| 12572 | /* MultiPortSwitch: '<S80>/Multiport Switch' incorporates: |
| 12573 | * Constant: '<S80>/SteeringControlSRC' |
| 12574 | * Constant: '<S80>/SteeringOverrideVal' |
| 12575 | */ |
| 12576 | switch (L4_MABX_P.SteeringControlSRC_Value) { |
| 12577 | case 0: |
| 12578 | L4_MABX_B.MultiportSwitch_f = L4_MABX_P.SteeringOverrideVal_Value; |
| 12579 | break; |
| 12580 | |
| 12581 | case 1: |
| 12582 | L4_MABX_B.MultiportSwitch_f = L4_MABX_B.Switch2_i; |
| 12583 | break; |
| 12584 | |
| 12585 | case 2: |
| 12586 | /* DataTypeConversion: '<S80>/Data Type Conversion2' */ |
| 12587 | L4_MABX_B.DataTypeConversion2_ox = L4_MABX_B.Add2; |
| 12588 | L4_MABX_B.MultiportSwitch_f = L4_MABX_B.DataTypeConversion2_ox; |
| 12589 | break; |
| 12590 | |
| 12591 | default: |
| 12592 | /* DataTypeConversion: '<S80>/Data Type Conversion3' */ |
| 12593 | L4_MABX_B.DataTypeConversion3_pl = L4_MABX_B.Add1_h; |
| 12594 | L4_MABX_B.MultiportSwitch_f = L4_MABX_B.DataTypeConversion3_pl; |
| 12595 | break; |
| 12596 | } |
| 12597 | |
| 12598 | /* End of MultiPortSwitch: '<S80>/Multiport Switch' */ |
| 12599 | |
| 12600 | /* Gain: '<S80>/rad2deg2' */ |
| 12601 | L4_MABX_B.rad2deg2 = L4_MABX_P.rad2deg2_Gain * L4_MABX_B.MultiportSwitch_f; |
| 12602 | L4_MABX_B.MultiportSwitch1 = L4_MABX_B.rad2deg2; |
| 12603 | break; |
| 12604 | |
| 12605 | case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE: |
| 12606 | L4_MABX_B.MultiportSwitch1 = L4_MABX_P.SteeringOverrideVal1_Value; |
| 12607 | break; |
| 12608 | |
| 12609 | default: |
| 12610 | L4_MABX_B.MultiportSwitch1 = SteerCommandDeg; |
| 12611 | break; |
| 12612 | } |
| 12613 | |
| 12614 | /* End of MultiPortSwitch: '<S80>/Multiport Switch1' */ |
| 12615 | |
| 12616 | /* Lookup_n-D: '<S276>/1D_Lookup_Table' */ |
| 12617 | L4_MABX_B.uD_Lookup_Table_a = look1_binlcapw(L4_MABX_B.MultiportSwitch1, |
| 12618 | STEERCTRL_WHEEL_ANGLE_STEP_MPV, STEERCTRL_WHEEL_ANGLE_DATA_MPV, 71U); |
| 12619 | |
| 12620 | /* DataTypeConversion: '<S80>/Data Type Conversion4' */ |
| 12621 | L4_MABX_B.numLanePoints_j = L4_MABX_B.DataTypeConversion5_e3d; |
| 12622 | |
| 12623 | /* DiscreteIntegrator: '<S80>/Discrete-Time Integrator' incorporates: |
| 12624 | * Constant: '<S80>/ResetIntegrator' |
| 12625 | */ |
| 12626 | if ((L4_MABX_P.ResetIntegrator_Value != 0.0) || |
| 12627 | (L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e != 0)) { |
| 12628 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e = |
| 12629 | L4_MABX_P.DiscreteTimeIntegrator_IC; |
| 12630 | } |
| 12631 | |
| 12632 | if (L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e >= |
| 12633 | L4_MABX_P.DiscreteTimeIntegrator_UpperSat) { |
| 12634 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e = |
| 12635 | L4_MABX_P.DiscreteTimeIntegrator_UpperSat; |
| 12636 | } else { |
| 12637 | if (L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e <= |
| 12638 | L4_MABX_P.DiscreteTimeIntegrator_LowerSat) { |
| 12639 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e = |
| 12640 | L4_MABX_P.DiscreteTimeIntegrator_LowerSat; |
| 12641 | } |
| 12642 | } |
| 12643 | |
| 12644 | L4_MABX_B.DiscreteTimeIntegrator_h = |
| 12645 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e; |
| 12646 | |
| 12647 | /* End of DiscreteIntegrator: '<S80>/Discrete-Time Integrator' */ |
| 12648 | |
| 12649 | /* RelationalOperator: '<S288>/Lower Test' incorporates: |
| 12650 | * Constant: '<S288>/Lower Limit' |
| 12651 | */ |
| 12652 | L4_MABX_B.LowerTest = (L4_MABX_P.IntervalTest_lowlimit <= L4_MABX_B.Divide_nn); |
| 12653 | |
| 12654 | /* RelationalOperator: '<S288>/Upper Test' incorporates: |
| 12655 | * Constant: '<S288>/Upper Limit' |
| 12656 | */ |
| 12657 | L4_MABX_B.UpperTest = (L4_MABX_B.Divide_nn <= L4_MABX_P.IntervalTest_uplimit); |
| 12658 | |
| 12659 | /* Logic: '<S288>/AND' */ |
| 12660 | L4_MABX_B.AND_p = (L4_MABX_B.LowerTest && L4_MABX_B.UpperTest); |
| 12661 | |
| 12662 | /* Assertion: '<S285>/Assertion' */ |
| 12663 | utAssert(L4_MABX_B.AND_p); |
| 12664 | |
| 12665 | /* RelationalOperator: '<S293>/Lower Test' incorporates: |
| 12666 | * Constant: '<S293>/Lower Limit' |
| 12667 | */ |
| 12668 | L4_MABX_B.LowerTest_l = (L4_MABX_P.IntervalTest_lowlimit_k <= |
| 12669 | L4_MABX_B.Divide_d0); |
| 12670 | |
| 12671 | /* RelationalOperator: '<S293>/Upper Test' incorporates: |
| 12672 | * Constant: '<S293>/Upper Limit' |
| 12673 | */ |
| 12674 | L4_MABX_B.UpperTest_e = (L4_MABX_B.Divide_d0 <= |
| 12675 | L4_MABX_P.IntervalTest_uplimit_e); |
| 12676 | |
| 12677 | /* Logic: '<S293>/AND' */ |
| 12678 | L4_MABX_B.AND_jt = (L4_MABX_B.LowerTest_l && L4_MABX_B.UpperTest_e); |
| 12679 | |
| 12680 | /* Assertion: '<S290>/Assertion' */ |
| 12681 | utAssert(L4_MABX_B.AND_jt); |
| 12682 | |
| 12683 | /* Switch: '<S296>/Switch' incorporates: |
| 12684 | * Constant: '<S279>/Constant8' |
| 12685 | * Constant: '<S279>/Constant9' |
| 12686 | */ |
| 12687 | if (L4_MABX_P.Constant8_Value_l) { |
| 12688 | L4_MABX_B.Switch_ko = L4_MABX_P.Constant9_Value; |
| 12689 | } else { |
| 12690 | L4_MABX_B.Switch_ko = L4_MABX_B.Add_px; |
| 12691 | } |
| 12692 | |
| 12693 | /* End of Switch: '<S296>/Switch' */ |
| 12694 | |
| 12695 | /* RelationalOperator: '<S80>/Relational Operator' incorporates: |
| 12696 | * Constant: '<S80>/Constant1' |
| 12697 | */ |
| 12698 | L4_MABX_B.RelationalOperator_oq = (L4_MABX_B.DataTypeConversion5_e3d >= |
| 12699 | L4_MABX_P.Constant1_Value_ls); |
| 12700 | |
| 12701 | /* Gain: '<S301>/Gain' */ |
| 12702 | L4_MABX_B.Gain_o = L4_MABX_P.Gain_Gain_p * L4_MABX_B.DiscreteTimeIntegrator; |
| 12703 | |
| 12704 | /* Gain: '<S307>/Integral Gain' */ |
| 12705 | L4_MABX_B.IntegralGain = Lateral_Control_I * L4_MABX_B.If_Then_Else1_m.Switch; |
| 12706 | |
| 12707 | /* Abs: '<S310>/Abs' */ |
| 12708 | L4_MABX_B.Abs_ig = fabs(L4_MABX_B.If_Then_Else_pe.Switch); |
| 12709 | |
| 12710 | /* Abs: '<S310>/Abs1' */ |
| 12711 | L4_MABX_B.Abs1_ft = fabs(L4_MABX_B.DifferenceInputs2); |
| 12712 | |
| 12713 | /* Sum: '<S310>/Subtract' */ |
| 12714 | L4_MABX_B.Subtract_o = Lateral_Control_Output - L4_MABX_B.DifferenceInputs2_m; |
| 12715 | |
| 12716 | /* Abs: '<S310>/Abs2' */ |
| 12717 | L4_MABX_B.Abs2_k = fabs(L4_MABX_B.Subtract_o); |
| 12718 | |
| 12719 | /* RelationalOperator: '<S319>/Compare' incorporates: |
| 12720 | * Constant: '<S319>/Constant' |
| 12721 | */ |
| 12722 | RateLimiterActive = (L4_MABX_B.Abs2_k > L4_MABX_P.CompareToConstant_const_g); |
| 12723 | |
| 12724 | /* Lookup_n-D: '<S310>/Curvature Lookup Table' */ |
| 12725 | L4_MABX_B.RateCurvature = look1_binlcapw(L4_MABX_B.Abs_ig, |
| 12726 | L4_MABX_P.CurvatureLookupTable_bp01Data, |
| 12727 | L4_MABX_P.CurvatureLookupTable_tableData, 4U); |
| 12728 | |
| 12729 | /* Lookup_n-D: '<S310>/Error Lookup Table' */ |
| 12730 | L4_MABX_B.RateError = look1_binlcapw(L4_MABX_B.Abs1_ft, |
| 12731 | L4_MABX_P.ErrorLookupTable_bp01Data, L4_MABX_P.ErrorLookupTable_tableData, |
| 12732 | 4U); |
| 12733 | |
| 12734 | /* MinMax: '<S310>/Max' */ |
| 12735 | DeltaTime = L4_MABX_B.RateCurvature; |
| 12736 | PositionFinalLimited = L4_MABX_B.RateError; |
| 12737 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 12738 | PositionFinalLimited = DeltaTime; |
| 12739 | } |
| 12740 | |
| 12741 | L4_MABX_B.Max = PositionFinalLimited; |
| 12742 | |
| 12743 | /* End of MinMax: '<S310>/Max' */ |
| 12744 | |
| 12745 | /* Lookup_n-D: '<S310>/Speed Lookup Table' */ |
| 12746 | L4_MABX_B.RateSpeed = look1_binlcapw(L4_MABX_B.DataTypeConversion_ku, |
| 12747 | L4_MABX_P.SpeedLookupTable_bp01Data, L4_MABX_P.SpeedLookupTable_tableData, |
| 12748 | 5U); |
| 12749 | |
| 12750 | /* MinMax: '<S310>/Min' */ |
| 12751 | DeltaTime = L4_MABX_B.Max; |
| 12752 | PositionFinalLimited = L4_MABX_B.RateSpeed; |
| 12753 | if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 12754 | PositionFinalLimited = DeltaTime; |
| 12755 | } |
| 12756 | |
| 12757 | L4_MABX_B.Min = PositionFinalLimited; |
| 12758 | |
| 12759 | /* End of MinMax: '<S310>/Min' */ |
| 12760 | |
| 12761 | /* RateLimiter: '<S310>/Limit Rate Limiter' */ |
| 12762 | PositionFinalLimited = L4_MABX_B.Min - L4_MABX_DW.PrevY; |
| 12763 | if (PositionFinalLimited > L4_MABX_P.LimitRateLimiter_RisingLim) { |
| 12764 | L4_MABX_B.RateLimitUpper = L4_MABX_DW.PrevY + |
| 12765 | L4_MABX_P.LimitRateLimiter_RisingLim; |
| 12766 | } else if (PositionFinalLimited < L4_MABX_P.LimitRateLimiter_FallingLim) { |
| 12767 | L4_MABX_B.RateLimitUpper = L4_MABX_DW.PrevY + |
| 12768 | L4_MABX_P.LimitRateLimiter_FallingLim; |
| 12769 | } else { |
| 12770 | L4_MABX_B.RateLimitUpper = L4_MABX_B.Min; |
| 12771 | } |
| 12772 | |
| 12773 | L4_MABX_DW.PrevY = L4_MABX_B.RateLimitUpper; |
| 12774 | |
| 12775 | /* End of RateLimiter: '<S310>/Limit Rate Limiter' */ |
| 12776 | |
| 12777 | /* Gain: '<S80>/sign2' */ |
| 12778 | DesiredSteeringAngle = L4_MABX_P.sign2_Gain * L4_MABX_B.uD_Lookup_Table_a; |
| 12779 | |
| 12780 | /* Sum: '<S80>/Subtract' incorporates: |
| 12781 | * Constant: '<S80>/Constant' |
| 12782 | */ |
| 12783 | L4_MABX_B.Subtract_c1 = DesiredSteeringAngle + REAX_OFFSET_APV; |
| 12784 | |
| 12785 | /* UnitDelay: '<S80>/Unit Delay' */ |
| 12786 | L4_MABX_B.UnitDelay_p = L4_MABX_DW.UnitDelay_DSTATE_e3; |
| 12787 | |
| 12788 | /* Switch: '<S80>/Switch1' incorporates: |
| 12789 | * Constant: '<S80>/Constant2' |
| 12790 | * Switch: '<S80>/Switch2' |
| 12791 | */ |
| 12792 | if (L4_MABX_B.RelationalOperator_oq) { |
| 12793 | /* Product: '<S80>/Product3' incorporates: |
| 12794 | * Constant: '<S80>/SteeringControlNewIGain1' |
| 12795 | */ |
| 12796 | L4_MABX_B.Product3 = L4_MABX_B.mm2m * |
| 12797 | L4_MABX_P.SteeringControlNewIGain1_Value; |
| 12798 | L4_MABX_B.Switch1_p = L4_MABX_B.Product3; |
| 12799 | |
| 12800 | /* Gain: '<S80>/deg2rad' */ |
| 12801 | L4_MABX_B.deg2rad_d = L4_MABX_P.deg2rad_Gain * L4_MABX_B.SFunction1_o1_d5; |
| 12802 | |
| 12803 | /* Product: '<S80>/Product2' incorporates: |
| 12804 | * Constant: '<S80>/SteeringControlNewPGain1' |
| 12805 | */ |
| 12806 | L4_MABX_B.Product2_my = L4_MABX_B.deg2rad_d * |
| 12807 | L4_MABX_P.SteeringControlNewPGain1_Value; |
| 12808 | L4_MABX_B.Switch2_i1 = L4_MABX_B.Product2_my; |
| 12809 | } else { |
| 12810 | L4_MABX_B.Switch1_p = L4_MABX_P.Constant2_Value_n; |
| 12811 | L4_MABX_B.Switch2_i1 = L4_MABX_B.UnitDelay_p; |
| 12812 | } |
| 12813 | |
| 12814 | /* End of Switch: '<S80>/Switch1' */ |
| 12815 | |
| 12816 | /* RelationalOperator: '<S353>/min_relop' incorporates: |
| 12817 | * Constant: '<S353>/min_val' |
| 12818 | */ |
| 12819 | L4_MABX_B.min_relop_k = (L4_MABX_P.CheckStaticLowerBound_min_o <= |
| 12820 | L4_MABX_B.Divide_e); |
| 12821 | |
| 12822 | /* Assertion: '<S353>/Assertion' */ |
| 12823 | utAssert(L4_MABX_B.min_relop_k); |
| 12824 | |
| 12825 | /* Logic: '<S362>/Logical Operator2' */ |
| 12826 | L4_MABX_B.LogicalOperator2_g = !L4_MABX_B.LogicalOperator1_ph; |
| 12827 | |
| 12828 | /* Switch: '<S371>/Reset' incorporates: |
| 12829 | * Constant: '<S366>/CPV' |
| 12830 | */ |
| 12831 | if (L4_MABX_B.LogicalOperator1_ja) { |
| 12832 | L4_MABX_B.Xnew = L4_MABX_P.CPV_Value_h; |
| 12833 | } else { |
| 12834 | L4_MABX_B.Xnew = L4_MABX_B.If_Then_Else_gf.Switch; |
| 12835 | } |
| 12836 | |
| 12837 | /* End of Switch: '<S371>/Reset' */ |
| 12838 | |
| 12839 | /* UnitDelay: '<S373>/FixPt Unit Delay2' */ |
| 12840 | L4_MABX_B.FixPtUnitDelay2_ji = L4_MABX_DW.FixPtUnitDelay2_DSTATE_aw; |
| 12841 | |
| 12842 | /* Logic: '<S373>/FixPt Logical Operator' */ |
| 12843 | L4_MABX_B.FixPtLogicalOperator_i = (uint8_T)(L4_MABX_B.LogicalOperator1_ja || |
| 12844 | (L4_MABX_B.FixPtUnitDelay2_ji != 0)); |
| 12845 | |
| 12846 | /* UnitDelay: '<S373>/FixPt Unit Delay1' */ |
| 12847 | L4_MABX_B.Xold_d = L4_MABX_DW.FixPtUnitDelay1_DSTATE_pe; |
| 12848 | |
| 12849 | /* Switch: '<S373>/Init' incorporates: |
| 12850 | * Constant: '<S367>/CPV' |
| 12851 | */ |
| 12852 | if (L4_MABX_B.FixPtLogicalOperator_i != 0) { |
| 12853 | L4_MABX_B.Init_o = L4_MABX_P.CPV_Value_n; |
| 12854 | } else { |
| 12855 | L4_MABX_B.Init_o = L4_MABX_B.Xold_d; |
| 12856 | } |
| 12857 | |
| 12858 | /* End of Switch: '<S373>/Init' */ |
| 12859 | |
| 12860 | /* UnitDelay: '<S374>/FixPt Unit Delay2' */ |
| 12861 | L4_MABX_B.FixPtUnitDelay2_mz = L4_MABX_DW.FixPtUnitDelay2_DSTATE_gx; |
| 12862 | |
| 12863 | /* Logic: '<S374>/FixPt Logical Operator' */ |
| 12864 | L4_MABX_B.FixPtLogicalOperator_b = (uint8_T)(L4_MABX_B.LogicalOperator1_ja || |
| 12865 | (L4_MABX_B.FixPtUnitDelay2_mz != 0)); |
| 12866 | |
| 12867 | /* UnitDelay: '<S374>/FixPt Unit Delay1' */ |
| 12868 | L4_MABX_B.Xold_mg = L4_MABX_DW.FixPtUnitDelay1_DSTATE_g0; |
| 12869 | |
| 12870 | /* Switch: '<S374>/Init' incorporates: |
| 12871 | * Constant: '<S365>/CPV2' |
| 12872 | */ |
| 12873 | if (L4_MABX_B.FixPtLogicalOperator_b != 0) { |
| 12874 | L4_MABX_B.Init_lg = L4_MABX_P.CPV2_Value_p; |
| 12875 | } else { |
| 12876 | L4_MABX_B.Init_lg = L4_MABX_B.Xold_mg; |
| 12877 | } |
| 12878 | |
| 12879 | /* End of Switch: '<S374>/Init' */ |
| 12880 | |
| 12881 | /* MultiPortSwitch: '<S372>/Multiport Switch' incorporates: |
| 12882 | * Constant: '<S365>/CPV2' |
| 12883 | * Constant: '<S372>/Integrator_method' |
| 12884 | */ |
| 12885 | switch ((int32_T)L4_MABX_P.Integrator_method_Value) { |
| 12886 | case 1: |
| 12887 | L4_MABX_B.MultiportSwitch_i = L4_MABX_P.CPV2_Value_p; |
| 12888 | break; |
| 12889 | |
| 12890 | case 2: |
| 12891 | L4_MABX_B.MultiportSwitch_i = L4_MABX_B.Init_lg; |
| 12892 | break; |
| 12893 | |
| 12894 | default: |
| 12895 | /* Sum: '<S372>/Add' incorporates: |
| 12896 | * Constant: '<S365>/CPV2' |
| 12897 | */ |
| 12898 | L4_MABX_B.Add_py = L4_MABX_B.Init_lg + L4_MABX_P.CPV2_Value_p; |
| 12899 | |
| 12900 | /* Gain: '<S372>/Gain' */ |
| 12901 | L4_MABX_B.u_trapezoidal = L4_MABX_P.Gain_Gain_j * L4_MABX_B.Add_py; |
| 12902 | L4_MABX_B.MultiportSwitch_i = L4_MABX_B.u_trapezoidal; |
| 12903 | break; |
| 12904 | } |
| 12905 | |
| 12906 | /* End of MultiPortSwitch: '<S372>/Multiport Switch' */ |
| 12907 | |
| 12908 | /* DigitalClock: '<S368>/Digital Clock' */ |
| 12909 | L4_MABX_B.DigitalClock_d = L4_MABX_M->Timing.t[0]; |
| 12910 | |
| 12911 | /* UnitDelay: '<S368>/Unit_Delay' */ |
| 12912 | L4_MABX_B.Unit_Delay_p = L4_MABX_DW.Unit_Delay_DSTATE_j; |
| 12913 | |
| 12914 | /* Sum: '<S368>/Subtract' */ |
| 12915 | L4_MABX_B.Subtract_k = L4_MABX_B.DigitalClock_d - L4_MABX_B.Unit_Delay_p; |
| 12916 | |
| 12917 | /* Product: '<S367>/Product1' incorporates: |
| 12918 | * Constant: '<S365>/CPV' |
| 12919 | */ |
| 12920 | L4_MABX_B.Product1_am = L4_MABX_P.CPV_Value_g * L4_MABX_B.MultiportSwitch_i * |
| 12921 | L4_MABX_B.Subtract_k; |
| 12922 | |
| 12923 | /* Sum: '<S367>/Add' */ |
| 12924 | L4_MABX_B.Add_db = L4_MABX_B.Init_o + L4_MABX_B.Product1_am; |
| 12925 | |
| 12926 | /* Switch: '<S374>/Reset' incorporates: |
| 12927 | * Constant: '<S365>/CPV2' |
| 12928 | */ |
| 12929 | L4_MABX_B.Xnew_f = L4_MABX_P.CPV2_Value_p; |
| 12930 | |
| 12931 | /* Switch: '<S373>/Reset' incorporates: |
| 12932 | * Constant: '<S367>/CPV' |
| 12933 | */ |
| 12934 | if (L4_MABX_B.LogicalOperator1_ja) { |
| 12935 | L4_MABX_B.Xnew_h = L4_MABX_P.CPV_Value_n; |
| 12936 | } else { |
| 12937 | L4_MABX_B.Xnew_h = L4_MABX_B.Add_db; |
| 12938 | } |
| 12939 | |
| 12940 | /* End of Switch: '<S373>/Reset' */ |
| 12941 | |
| 12942 | /* RelationalOperator: '<S381>/min_relop' incorporates: |
| 12943 | * Constant: '<S345>/FCW_CTRL_SLEW_INC_APV' |
| 12944 | * Constant: '<S381>/min_val' |
| 12945 | */ |
| 12946 | L4_MABX_B.min_relop_cb = (L4_MABX_P.CheckStaticLowerBound_min_h <= |
| 12947 | L4_MABX_P.FCW_CTRL_SLEW_INC_APV_Value); |
| 12948 | |
| 12949 | /* Assertion: '<S381>/Assertion' */ |
| 12950 | utAssert(L4_MABX_B.min_relop_cb); |
| 12951 | |
| 12952 | /* RelationalOperator: '<S392>/min_relop' incorporates: |
| 12953 | * Constant: '<S347>/STABILITY_CTRL_SLEW_INC_APV' |
| 12954 | * Constant: '<S392>/min_val' |
| 12955 | */ |
| 12956 | L4_MABX_B.min_relop_f = (L4_MABX_P.CheckStaticLowerBound_min_nz <= |
| 12957 | L4_MABX_P.STABILITY_CTRL_SLEW_INC_APV_Val); |
| 12958 | |
| 12959 | /* Assertion: '<S392>/Assertion' */ |
| 12960 | utAssert(L4_MABX_B.min_relop_f); |
| 12961 | |
| 12962 | /* End of Outputs for SubSystem: '<S65>/Task_10ms' */ |
| 12963 | |
| 12964 | /* Outputs for Enabled SubSystem: '<S625>/PosRapidUpdate_011' incorporates: |
| 12965 | * EnablePort: '<S626>/Enable' |
| 12966 | */ |
| 12967 | /* Constant: '<S448>/Constant' */ |
| 12968 | if (L4_MABX_P.Constant_Value_ilh > 0.0) { |
| 12969 | /* S-Function (rti_commonblock): '<S626>/S-Function1' */ |
| 12970 | /* This comment workarounds a code generation problem */ |
| 12971 | |
| 12972 | /* dSPACE RTICAN RX Message Block: "PosRapidUpdate_01" Id:167248128 */ |
| 12973 | { |
| 12974 | UInt32 *CAN_Msg; |
| 12975 | static dsfloat time_old = 0.0; |
| 12976 | |
| 12977 | /* Read status and timestamp info (previous message) */ |
| 12978 | if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80100].timestamp != |
| 12979 | time_old) { |
| 12980 | /* ... save timestamp info for the calculation of the RX status |
| 12981 | during the consecutive sample hit*/ |
| 12982 | time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80100]. |
| 12983 | timestamp; |
| 12984 | |
| 12985 | /* ... set the processed flag to one */ |
| 12986 | L4_MABX_B.SFunction1_o3_lm = 1.0; |
| 12987 | L4_MABX_B.SFunction1_o4_aq = (real_T) |
| 12988 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80100].timestamp; |
| 12989 | L4_MABX_B.SFunction1_o5_o = (real_T) |
| 12990 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80100].deltatime; |
| 12991 | CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80100].data; |
| 12992 | |
| 12993 | /* Decode CAN message */ |
| 12994 | { |
| 12995 | { |
| 12996 | rtican_Signal_t CAN_Sgn; |
| 12997 | |
| 12998 | /* ...... "Latitude_" (0|32, standard signal, signed int, little endian) */ |
| 12999 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 13000 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 13001 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[2]; |
| 13002 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[3]; |
| 13003 | L4_MABX_B.SFunction1_o1_l1 = 1.0E-7 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 13004 | ); |
| 13005 | |
| 13006 | /* ...... "Longitude_" (32|32, standard signal, signed int, little endian) */ |
| 13007 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 13008 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 13009 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[6]; |
| 13010 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[7]; |
| 13011 | L4_MABX_B.SFunction1_o2_ic = 1.0E-7 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 13012 | ); |
| 13013 | } |
| 13014 | } |
| 13015 | } else { |
| 13016 | /* set RX status to 0 because no new message has arrived */ |
| 13017 | L4_MABX_B.SFunction1_o3_lm = 0.0; |
| 13018 | } |
| 13019 | } |
| 13020 | } |
| 13021 | |
| 13022 | /* End of Outputs for SubSystem: '<S625>/PosRapidUpdate_011' */ |
| 13023 | |
| 13024 | /* Outputs for Atomic SubSystem: '<S466>/If_Then_Else' */ |
| 13025 | |
| 13026 | /* Constant: '<S466>/useGPSSA00' incorporates: |
| 13027 | * Constant: '<S466>/useGPSSA0' |
| 13028 | */ |
| 13029 | L4_MABX_If_Then_Else3(L4_MABX_B.LogicalOperator1_e, L4_MABX_P.useGPSSA00_Value, |
| 13030 | L4_MABX_P.useGPSSA0_Value, &L4_MABX_B.If_Then_Else); |
| 13031 | |
| 13032 | /* End of Outputs for SubSystem: '<S466>/If_Then_Else' */ |
| 13033 | |
| 13034 | /* Outputs for Enabled SubSystem: '<S625>/PosRapidUpdate_1' incorporates: |
| 13035 | * EnablePort: '<S627>/Enable' |
| 13036 | */ |
| 13037 | /* Constant: '<S448>/Constant' */ |
| 13038 | if (L4_MABX_P.Constant_Value_ilh > 0.0) { |
| 13039 | /* S-Function (rti_commonblock): '<S627>/S-Function1' */ |
| 13040 | /* This comment workarounds a code generation problem */ |
| 13041 | |
| 13042 | /* dSPACE RTICAN RX Message Block: "PosRapidUpdate_01" Id:167248129 */ |
| 13043 | { |
| 13044 | UInt32 *CAN_Msg; |
| 13045 | static dsfloat time_old = 0.0; |
| 13046 | |
| 13047 | /* Read status and timestamp info (previous message) */ |
| 13048 | if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80101].timestamp != |
| 13049 | time_old) { |
| 13050 | /* ... save timestamp info for the calculation of the RX status |
| 13051 | during the consecutive sample hit*/ |
| 13052 | time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80101]. |
| 13053 | timestamp; |
| 13054 | |
| 13055 | /* ... set the processed flag to one */ |
| 13056 | L4_MABX_B.SFunction1_o3_lxw = 1.0; |
| 13057 | L4_MABX_B.SFunction1_o4_ls = (real_T) |
| 13058 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80101].timestamp; |
| 13059 | L4_MABX_B.SFunction1_o5_f = (real_T) |
| 13060 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80101].deltatime; |
| 13061 | CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80101].data; |
| 13062 | |
| 13063 | /* Decode CAN message */ |
| 13064 | { |
| 13065 | { |
| 13066 | rtican_Signal_t CAN_Sgn; |
| 13067 | |
| 13068 | /* ...... "Latitude_" (0|32, standard signal, signed int, little endian) */ |
| 13069 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 13070 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 13071 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[2]; |
| 13072 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[3]; |
| 13073 | L4_MABX_B.SFunction1_o1_de = 1.0E-7 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 13074 | ); |
| 13075 | |
| 13076 | /* ...... "Longitude_" (32|32, standard signal, signed int, little endian) */ |
| 13077 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 13078 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 13079 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[6]; |
| 13080 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[7]; |
| 13081 | L4_MABX_B.SFunction1_o2_ez = 1.0E-7 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 13082 | ); |
| 13083 | } |
| 13084 | } |
| 13085 | } else { |
| 13086 | /* set RX status to 0 because no new message has arrived */ |
| 13087 | L4_MABX_B.SFunction1_o3_lxw = 0.0; |
| 13088 | } |
| 13089 | } |
| 13090 | } |
| 13091 | |
| 13092 | /* End of Outputs for SubSystem: '<S625>/PosRapidUpdate_1' */ |
| 13093 | |
| 13094 | /* Switch: '<S625>/Switch' */ |
| 13095 | if (L4_MABX_B.If_Then_Else.Switch) { |
| 13096 | L4_MABX_B.Latitude_ = L4_MABX_B.SFunction1_o1_l1; |
| 13097 | L4_MABX_B.Longitude_ = L4_MABX_B.SFunction1_o2_ic; |
| 13098 | } else { |
| 13099 | L4_MABX_B.Latitude_ = L4_MABX_B.SFunction1_o1_de; |
| 13100 | L4_MABX_B.Longitude_ = L4_MABX_B.SFunction1_o2_ez; |
| 13101 | } |
| 13102 | |
| 13103 | /* Outputs for Enabled SubSystem: '<S505>/CCVS1_00' incorporates: |
| 13104 | * EnablePort: '<S506>/Enable' |
| 13105 | */ |
| 13106 | /* Constant: '<S429>/Constant' */ |
| 13107 | if (L4_MABX_P.Constant_Value_lb) { |
| 13108 | /* S-Function (rti_commonblock): '<S506>/S-Function1' */ |
| 13109 | /* This comment workarounds a code generation problem */ |
| 13110 | |
| 13111 | /* dSPACE RTICAN RX Message Block: "CCVS1_00" Id:218034432 */ |
| 13112 | { |
| 13113 | UInt32 *CAN_Msg; |
| 13114 | static dsfloat time_old = 0.0; |
| 13115 | |
| 13116 | /* Read status and timestamp info (previous message) */ |
| 13117 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCFEF100].timestamp != |
| 13118 | time_old) { |
| 13119 | /* ... save timestamp info for the calculation of the RX status |
| 13120 | during the consecutive sample hit*/ |
| 13121 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCFEF100]. |
| 13122 | timestamp; |
| 13123 | |
| 13124 | /* ... set the processed flag to one */ |
| 13125 | L4_MABX_B.SFunction1_o21_mw = 1.0; |
| 13126 | L4_MABX_B.SFunction1_o22_ft = (real_T) |
| 13127 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCFEF100].timestamp; |
| 13128 | L4_MABX_B.SFunction1_o23_n = (real_T) |
| 13129 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCFEF100].deltatime; |
| 13130 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCFEF100].data; |
| 13131 | |
| 13132 | /* Decode CAN message */ |
| 13133 | { |
| 13134 | { |
| 13135 | rtican_Signal_t CAN_Sgn; |
| 13136 | |
| 13137 | /* ...... "TwoSpeedAxleSwitch" (0|2, standard signal, unsigned int, little endian) */ |
| 13138 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 13139 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13140 | L4_MABX_B.SFunction1_o1_fd = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13141 | |
| 13142 | /* ...... "ParkingBrakeSwitch" (2|2, standard signal, unsigned int, little endian) */ |
| 13143 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 13144 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 13145 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13146 | L4_MABX_B.SFunction1_o2_ij = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13147 | |
| 13148 | /* ...... "CruiseCtrlPauseSwitch" (4|2, standard signal, unsigned int, little endian) */ |
| 13149 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 13150 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 13151 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13152 | L4_MABX_B.SFunction1_o3_l1 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13153 | |
| 13154 | /* ...... "ParkBrakeReleaseInhibitRq" (6|2, standard signal, unsigned int, little endian) */ |
| 13155 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 13156 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 13157 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13158 | L4_MABX_B.SFunction1_o4_fw = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13159 | |
| 13160 | /* ...... "WheelBasedVehicleSpeed" (8|16, standard signal, unsigned int, little endian) */ |
| 13161 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 13162 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 13163 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 13164 | WheelBasedVehicleSpeed = 0.00390625 * ( ((real_T) |
| 13165 | CAN_Sgn.UnsignedSgn) ); |
| 13166 | |
| 13167 | /* ...... "CruiseCtrlActive" (24|2, standard signal, unsigned int, little endian) */ |
| 13168 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 13169 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13170 | L4_MABX_B.SFunction1_o6_jo = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13171 | |
| 13172 | /* ...... "CruiseCtrlEnableSwitch" (26|2, standard signal, unsigned int, little endian) */ |
| 13173 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 13174 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 13175 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13176 | L4_MABX_B.SFunction1_o7_ba = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13177 | |
| 13178 | /* ...... "BrakeSwitch" (28|2, standard signal, unsigned int, little endian) */ |
| 13179 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 13180 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 13181 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13182 | BrakeSwitch = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13183 | |
| 13184 | /* ...... "ClutchSwitch" (30|2, standard signal, unsigned int, little endian) */ |
| 13185 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 13186 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 13187 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13188 | L4_MABX_B.SFunction1_o9_ig = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13189 | |
| 13190 | /* ...... "CruiseCtrlSetSwitch" (32|2, standard signal, unsigned int, little endian) */ |
| 13191 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 13192 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13193 | L4_MABX_B.SFunction1_o10_i = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13194 | |
| 13195 | /* ...... "CruiseCtrlCoastSwitch" (34|2, standard signal, unsigned int, little endian) */ |
| 13196 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 13197 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 13198 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13199 | L4_MABX_B.SFunction1_o11_j = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13200 | |
| 13201 | /* ...... "CruiseCtrlResumeSwitch" (36|2, standard signal, unsigned int, little endian) */ |
| 13202 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 13203 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 13204 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13205 | L4_MABX_B.SFunction1_o12_bc = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13206 | |
| 13207 | /* ...... "CruiseCtrlAccelerateSwitch" (38|2, standard signal, unsigned int, little endian) */ |
| 13208 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 13209 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 13210 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13211 | L4_MABX_B.SFunction1_o13_oz = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13212 | |
| 13213 | /* ...... "CruiseCtrlSetSpeed" (40|8, standard signal, unsigned int, little endian) */ |
| 13214 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 13215 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 13216 | L4_MABX_B.SFunction1_o14_en = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13217 | |
| 13218 | /* ...... "PTOGovernorState" (48|5, standard signal, unsigned int, little endian) */ |
| 13219 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 13220 | CAN_Sgn.UnsignedSgn &= 0x0000001F; |
| 13221 | L4_MABX_B.SFunction1_o15_i = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13222 | |
| 13223 | /* ...... "CruiseCtrlStates" (53|3, standard signal, unsigned int, little endian) */ |
| 13224 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 13225 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 5; |
| 13226 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 13227 | L4_MABX_B.SFunction1_o16_fi = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13228 | |
| 13229 | /* ...... "EngIdleIncrementSwitch" (56|2, standard signal, unsigned int, little endian) */ |
| 13230 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 13231 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13232 | L4_MABX_B.SFunction1_o17_e = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13233 | |
| 13234 | /* ...... "EngIdleDecrementSwitch" (58|2, standard signal, unsigned int, little endian) */ |
| 13235 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 13236 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 13237 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13238 | L4_MABX_B.SFunction1_o18_i = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13239 | |
| 13240 | /* ...... "EngTestModeSwitch" (60|2, standard signal, unsigned int, little endian) */ |
| 13241 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 13242 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 13243 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13244 | L4_MABX_B.SFunction1_o19_e = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13245 | |
| 13246 | /* ...... "EngShutdownOverrideSwitch" (62|2, standard signal, unsigned int, little endian) */ |
| 13247 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 13248 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 13249 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13250 | L4_MABX_B.SFunction1_o20_l = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13251 | } |
| 13252 | } |
| 13253 | } else { |
| 13254 | /* set RX status to 0 because no new message has arrived */ |
| 13255 | L4_MABX_B.SFunction1_o21_mw = 0.0; |
| 13256 | } |
| 13257 | } |
| 13258 | } |
| 13259 | |
| 13260 | /* End of Constant: '<S429>/Constant' */ |
| 13261 | /* End of Outputs for SubSystem: '<S505>/CCVS1_00' */ |
| 13262 | |
| 13263 | /* Outputs for Enabled SubSystem: '<S509>/COGSOGRapidUpdate_00' incorporates: |
| 13264 | * EnablePort: '<S510>/Enable' |
| 13265 | */ |
| 13266 | /* Constant: '<S431>/Constant' */ |
| 13267 | if (L4_MABX_P.Constant_Value_nm > 0.0) { |
| 13268 | /* S-Function (rti_commonblock): '<S510>/S-Function1' */ |
| 13269 | /* This comment workarounds a code generation problem */ |
| 13270 | |
| 13271 | /* dSPACE RTICAN RX Message Block: "COGSOGRapidUpdate_00" Id:167248384 */ |
| 13272 | { |
| 13273 | UInt32 *CAN_Msg; |
| 13274 | static dsfloat time_old = 0.0; |
| 13275 | |
| 13276 | /* Read status and timestamp info (previous message) */ |
| 13277 | if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80200].timestamp != |
| 13278 | time_old) { |
| 13279 | /* ... save timestamp info for the calculation of the RX status |
| 13280 | during the consecutive sample hit*/ |
| 13281 | time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80200]. |
| 13282 | timestamp; |
| 13283 | |
| 13284 | /* ... set the processed flag to one */ |
| 13285 | L4_MABX_B.SFunction1_o5_fi = 1.0; |
| 13286 | L4_MABX_B.SFunction1_o6_db = (real_T) |
| 13287 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80200].timestamp; |
| 13288 | L4_MABX_B.SFunction1_o7_ln = (real_T) |
| 13289 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80200].deltatime; |
| 13290 | CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80200].data; |
| 13291 | |
| 13292 | /* Decode CAN message */ |
| 13293 | { |
| 13294 | { |
| 13295 | rtican_Signal_t CAN_Sgn; |
| 13296 | |
| 13297 | /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */ |
| 13298 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 13299 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 13300 | L4_MABX_B.SFunction1_o1_jo = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13301 | |
| 13302 | /* ...... "COGReference" (8|2, standard signal, unsigned int, little endian) */ |
| 13303 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 13304 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13305 | L4_MABX_B.SFunction1_o2_i2 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13306 | |
| 13307 | /* ...... "CourseOverGround" (16|16, standard signal, unsigned int, little endian) */ |
| 13308 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 13309 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 13310 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 13311 | L4_MABX_B.SFunction1_o3_o1 = 0.0001 * ( ((real_T) |
| 13312 | CAN_Sgn.UnsignedSgn) ); |
| 13313 | |
| 13314 | /* ...... "SpeedOverGround" (32|16, standard signal, unsigned int, little endian) */ |
| 13315 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 13316 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 13317 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 13318 | L4_MABX_B.SFunction1_o4_kv = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 13319 | ); |
| 13320 | } |
| 13321 | } |
| 13322 | } else { |
| 13323 | /* set RX status to 0 because no new message has arrived */ |
| 13324 | L4_MABX_B.SFunction1_o5_fi = 0.0; |
| 13325 | } |
| 13326 | } |
| 13327 | } |
| 13328 | |
| 13329 | /* End of Outputs for SubSystem: '<S509>/COGSOGRapidUpdate_00' */ |
| 13330 | |
| 13331 | /* DataTypeConversion: '<S509>/Data Type Conversion8' */ |
| 13332 | L4_MABX_B.RX_status_o = (L4_MABX_B.SFunction1_o5_fi != 0.0); |
| 13333 | |
| 13334 | /* Outputs for Enabled SubSystem: '<S509>/COGSOGRapidUpdate_1' incorporates: |
| 13335 | * EnablePort: '<S511>/Enable' |
| 13336 | */ |
| 13337 | /* Constant: '<S431>/Constant' */ |
| 13338 | if (L4_MABX_P.Constant_Value_nm > 0.0) { |
| 13339 | /* S-Function (rti_commonblock): '<S511>/S-Function1' */ |
| 13340 | /* This comment workarounds a code generation problem */ |
| 13341 | |
| 13342 | /* dSPACE RTICAN RX Message Block: "COGSOGRapidUpdate_00" Id:167248385 */ |
| 13343 | { |
| 13344 | UInt32 *CAN_Msg; |
| 13345 | static dsfloat time_old = 0.0; |
| 13346 | |
| 13347 | /* Read status and timestamp info (previous message) */ |
| 13348 | if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80201].timestamp != |
| 13349 | time_old) { |
| 13350 | /* ... save timestamp info for the calculation of the RX status |
| 13351 | during the consecutive sample hit*/ |
| 13352 | time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80201]. |
| 13353 | timestamp; |
| 13354 | |
| 13355 | /* ... set the processed flag to one */ |
| 13356 | L4_MABX_B.SFunction1_o5_fh = 1.0; |
| 13357 | L4_MABX_B.SFunction1_o6_e5 = (real_T) |
| 13358 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80201].timestamp; |
| 13359 | L4_MABX_B.SFunction1_o7_a4 = (real_T) |
| 13360 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80201].deltatime; |
| 13361 | CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80201].data; |
| 13362 | |
| 13363 | /* Decode CAN message */ |
| 13364 | { |
| 13365 | { |
| 13366 | rtican_Signal_t CAN_Sgn; |
| 13367 | |
| 13368 | /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */ |
| 13369 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 13370 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 13371 | L4_MABX_B.SFunction1_o1_nl = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13372 | |
| 13373 | /* ...... "COGReference" (8|2, standard signal, unsigned int, little endian) */ |
| 13374 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 13375 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 13376 | L4_MABX_B.SFunction1_o2_c0 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 13377 | |
| 13378 | /* ...... "CourseOverGround" (16|16, standard signal, unsigned int, little endian) */ |
| 13379 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 13380 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 13381 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 13382 | L4_MABX_B.SFunction1_o3_ar = 0.0001 * ( ((real_T) |
| 13383 | CAN_Sgn.UnsignedSgn) ); |
| 13384 | |
| 13385 | /* ...... "SpeedOverGround" (32|16, standard signal, unsigned int, little endian) */ |
| 13386 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 13387 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 13388 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 13389 | L4_MABX_B.SFunction1_o4_po = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 13390 | ); |
| 13391 | } |
| 13392 | } |
| 13393 | } else { |
| 13394 | /* set RX status to 0 because no new message has arrived */ |
| 13395 | L4_MABX_B.SFunction1_o5_fh = 0.0; |
| 13396 | } |
| 13397 | } |
| 13398 | } |
| 13399 | |
| 13400 | /* End of Outputs for SubSystem: '<S509>/COGSOGRapidUpdate_1' */ |
| 13401 | |
| 13402 | /* Switch: '<S509>/Switch' */ |
| 13403 | if (L4_MABX_B.RX_status_o) { |
| 13404 | L4_MABX_B.SID = L4_MABX_B.SFunction1_o1_jo; |
| 13405 | L4_MABX_B.COGReference = L4_MABX_B.SFunction1_o2_i2; |
| 13406 | L4_MABX_B.CourseOverGround = L4_MABX_B.SFunction1_o3_o1; |
| 13407 | L4_MABX_B.SpeedOverGround = L4_MABX_B.SFunction1_o4_kv; |
| 13408 | } else { |
| 13409 | L4_MABX_B.SID = L4_MABX_B.SFunction1_o1_nl; |
| 13410 | L4_MABX_B.COGReference = L4_MABX_B.SFunction1_o2_c0; |
| 13411 | L4_MABX_B.CourseOverGround = L4_MABX_B.SFunction1_o3_ar; |
| 13412 | L4_MABX_B.SpeedOverGround = L4_MABX_B.SFunction1_o4_po; |
| 13413 | } |
| 13414 | |
| 13415 | /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_100ms' */ |
| 13416 | |
| 13417 | /* RateTransition: '<S886>/TmpRTBAtHiddenBuf_InsertedFor_Rolling_15_counter_at_inport_0Inport1' */ |
| 13418 | if (L4_MABX_M->Timing.RateInteraction.TID0_3 == 1) { |
| 13419 | L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_R = AutonomousOutputEnabled; |
| 13420 | |
| 13421 | /* RateTransition: '<S904>/TmpRTBAtOperatorInport1' */ |
| 13422 | L4_MABX_B.TmpRTBAtOperatorInport1 = AutonomousOutputEnabled; |
| 13423 | |
| 13424 | /* RateTransition: '<S907>/TmpRTBAtOperatorInport1' */ |
| 13425 | L4_MABX_B.TmpRTBAtOperatorInport1_h = AutonomousOutputEnabled; |
| 13426 | |
| 13427 | /* RateTransition: '<S898>/TmpRTBAtOperatorInport1' */ |
| 13428 | L4_MABX_B.TmpRTBAtOperatorInport1_k = AutonomousOutputEnabled; |
| 13429 | |
| 13430 | /* RateTransition: '<S899>/TmpRTBAtOperatorInport1' */ |
| 13431 | L4_MABX_B.TmpRTBAtOperatorInport1_a = AutonomousOutputEnabled; |
| 13432 | |
| 13433 | /* RateTransition: '<S905>/TmpRTBAtOperatorInport1' */ |
| 13434 | L4_MABX_B.TmpRTBAtOperatorInport1_j = AutonomousOutputEnabled; |
| 13435 | |
| 13436 | /* RateTransition: '<S906>/TmpRTBAtOperatorInport1' */ |
| 13437 | L4_MABX_B.TmpRTBAtOperatorInport1_b = AutonomousOutputEnabled; |
| 13438 | L4_MABX_B.Latitude__g = L4_MABX_B.Latitude_; |
| 13439 | L4_MABX_B.Longitude__p = L4_MABX_B.Longitude_; |
| 13440 | L4_MABX_B.TwoSpeedAxleSwitch_n = L4_MABX_B.SFunction1_o1_fd; |
| 13441 | L4_MABX_B.ParkingBrakeSwitch_p = L4_MABX_B.SFunction1_o2_ij; |
| 13442 | L4_MABX_B.CruiseCtrlPauseSwitch_o = L4_MABX_B.SFunction1_o3_l1; |
| 13443 | L4_MABX_B.ParkBrakeReleaseInhibitRq_l = L4_MABX_B.SFunction1_o4_fw; |
| 13444 | L4_MABX_B.WheelBasedVehicleSpeed_hl = WheelBasedVehicleSpeed; |
| 13445 | L4_MABX_B.CruiseCtrlActive_l = L4_MABX_B.SFunction1_o6_jo; |
| 13446 | L4_MABX_B.CruiseCtrlEnableSwitch_nw = L4_MABX_B.SFunction1_o7_ba; |
| 13447 | L4_MABX_B.BrakeSwitch_im = BrakeSwitch; |
| 13448 | L4_MABX_B.ClutchSwitch_a = L4_MABX_B.SFunction1_o9_ig; |
| 13449 | L4_MABX_B.CruiseCtrlSetSwitch_h = L4_MABX_B.SFunction1_o10_i; |
| 13450 | L4_MABX_B.CruiseCtrlCoastSwitch_b = L4_MABX_B.SFunction1_o11_j; |
| 13451 | L4_MABX_B.CruiseCtrlResumeSwitch_j = L4_MABX_B.SFunction1_o12_bc; |
| 13452 | L4_MABX_B.CruiseCtrlAccelerateSwitch_h = L4_MABX_B.SFunction1_o13_oz; |
| 13453 | L4_MABX_B.CruiseCtrlSetSpeed_o = L4_MABX_B.SFunction1_o14_en; |
| 13454 | L4_MABX_B.PTOGovernorState_g = L4_MABX_B.SFunction1_o15_i; |
| 13455 | L4_MABX_B.CruiseCtrlStates_a = L4_MABX_B.SFunction1_o16_fi; |
| 13456 | L4_MABX_B.EngIdleIncrementSwitch_j = L4_MABX_B.SFunction1_o17_e; |
| 13457 | L4_MABX_B.EngIdleDecrementSwitch_j = L4_MABX_B.SFunction1_o18_i; |
| 13458 | L4_MABX_B.EngTestModeSwitch_e = L4_MABX_B.SFunction1_o19_e; |
| 13459 | L4_MABX_B.EngShutdownOverrideSwitch_l = L4_MABX_B.SFunction1_o20_l; |
| 13460 | L4_MABX_B.TwoSpeedAxleSwitch_nr = L4_MABX_B.SFunction1_o1_fd; |
| 13461 | L4_MABX_B.ParkingBrakeSwitch_pk = L4_MABX_B.SFunction1_o2_ij; |
| 13462 | L4_MABX_B.CruiseCtrlPauseSwitch_oq = L4_MABX_B.SFunction1_o3_l1; |
| 13463 | L4_MABX_B.ParkBrakeReleaseInhibitRq_lm = L4_MABX_B.SFunction1_o4_fw; |
| 13464 | L4_MABX_B.WheelBasedVehicleSpeed_hln = WheelBasedVehicleSpeed; |
| 13465 | L4_MABX_B.CruiseCtrlActive_lh = L4_MABX_B.SFunction1_o6_jo; |
| 13466 | L4_MABX_B.CruiseCtrlEnableSwitch_nwy = L4_MABX_B.SFunction1_o7_ba; |
| 13467 | L4_MABX_B.BrakeSwitch_imh = BrakeSwitch; |
| 13468 | L4_MABX_B.ClutchSwitch_ae = L4_MABX_B.SFunction1_o9_ig; |
| 13469 | L4_MABX_B.CruiseCtrlSetSwitch_hr = L4_MABX_B.SFunction1_o10_i; |
| 13470 | L4_MABX_B.CruiseCtrlCoastSwitch_bg = L4_MABX_B.SFunction1_o11_j; |
| 13471 | L4_MABX_B.CruiseCtrlResumeSwitch_j2 = L4_MABX_B.SFunction1_o12_bc; |
| 13472 | L4_MABX_B.CruiseCtrlAccelerateSwitch_h1 = L4_MABX_B.SFunction1_o13_oz; |
| 13473 | L4_MABX_B.CruiseCtrlSetSpeed_o0 = L4_MABX_B.SFunction1_o14_en; |
| 13474 | L4_MABX_B.PTOGovernorState_gd = L4_MABX_B.SFunction1_o15_i; |
| 13475 | L4_MABX_B.CruiseCtrlStates_ah = L4_MABX_B.SFunction1_o16_fi; |
| 13476 | L4_MABX_B.EngIdleIncrementSwitch_jk = L4_MABX_B.SFunction1_o17_e; |
| 13477 | L4_MABX_B.EngIdleDecrementSwitch_j2 = L4_MABX_B.SFunction1_o18_i; |
| 13478 | L4_MABX_B.EngTestModeSwitch_em = L4_MABX_B.SFunction1_o19_e; |
| 13479 | L4_MABX_B.EngShutdownOverrideSwitch_lp = L4_MABX_B.SFunction1_o20_l; |
| 13480 | L4_MABX_B.SID_lz = L4_MABX_B.SID; |
| 13481 | L4_MABX_B.COGReference_e = L4_MABX_B.COGReference; |
| 13482 | L4_MABX_B.CourseOverGround_p = L4_MABX_B.CourseOverGround; |
| 13483 | L4_MABX_B.SpeedOverGround_a = L4_MABX_B.SpeedOverGround; |
| 13484 | L4_MABX_B.ASREngCtrlActive = L4_MABX_B.SFunction1_o1_ir; |
| 13485 | L4_MABX_B.ASRBrakeCtrlActive = L4_MABX_B.SFunction1_o2_cb; |
| 13486 | L4_MABX_B.AntiLockBrakingActive = L4_MABX_B.SFunction1_o3_i1; |
| 13487 | L4_MABX_B.EBSBrakeSwitch_b = L4_MABX_B.SFunction1_o4_mt; |
| 13488 | L4_MABX_B.BrakePedalPos = L4_MABX_B.SFunction1_o5_ma; |
| 13489 | L4_MABX_B.ABSOffroadSwitch = L4_MABX_B.SFunction1_o6_ho; |
| 13490 | L4_MABX_B.ASROffroadSwitch = L4_MABX_B.SFunction1_o7_kf; |
| 13491 | L4_MABX_B.ASRHillHolderSwitch = L4_MABX_B.SFunction1_o8_pf; |
| 13492 | L4_MABX_B.TractionCtrlOverrideSwitch = L4_MABX_B.SFunction1_o9_oj; |
| 13493 | L4_MABX_B.AccelInterlockSwitch = L4_MABX_B.SFunction1_o10_d; |
| 13494 | L4_MABX_B.EngDerateSwitch = L4_MABX_B.SFunction1_o11_m; |
| 13495 | L4_MABX_B.EngAuxShutdownSwitch = L4_MABX_B.SFunction1_o12_b; |
| 13496 | L4_MABX_B.RemoteAccelEnableSwitch = L4_MABX_B.SFunction1_o13_p; |
| 13497 | L4_MABX_B.EngRetarderSelection = L4_MABX_B.SFunction1_o14_e; |
| 13498 | L4_MABX_B.ABSFullyOperational = L4_MABX_B.SFunction1_o15_j; |
| 13499 | L4_MABX_B.EBSRedWarningSignal = L4_MABX_B.SFunction1_o16_f; |
| 13500 | L4_MABX_B.ABS_EBSAmberWarningSignal = L4_MABX_B.SFunction1_o17_h; |
| 13501 | L4_MABX_B.ATC_ASRInformationSignal = L4_MABX_B.SFunction1_o18_o; |
| 13502 | L4_MABX_B.SrcAddrssOfCtrllngDvcFrBrkCntrl = L4_MABX_B.SFunction1_o19_f; |
| 13503 | L4_MABX_B.HaltBrakeSwitch = L4_MABX_B.SFunction1_o20_g; |
| 13504 | L4_MABX_B.TrailerABSStatus = L4_MABX_B.SFunction1_o21_f; |
| 13505 | L4_MABX_B.TrctrMntdTrilerABSWarningSignal = L4_MABX_B.SFunction1_o22_k; |
| 13506 | } |
| 13507 | |
| 13508 | /* End of Outputs for SubSystem: '<S849>/CAN_TX_100ms' */ |
| 13509 | |
| 13510 | /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_10ms' */ |
| 13511 | |
| 13512 | /* DataTypeConversion: '<S951>/Data Type Conversion4' */ |
| 13513 | L4_MABX_B.DataTypeConversion4_i = L4_MABX_B.Diff; |
| 13514 | |
| 13515 | /* DataTypeConversion: '<S940>/Data Type Conversion' incorporates: |
| 13516 | * Constant: '<S854>/CANT_ACCS_E4_CHANNEL_APV' |
| 13517 | */ |
| 13518 | L4_MABX_B.DataTypeConversion_er = (uint8_T) |
| 13519 | L4_MABX_P.CANT_ACCS_E4_CHANNEL_APV_Value; |
| 13520 | |
| 13521 | /* S-Function (sfix_bitop): '<S948>/Operator' */ |
| 13522 | L4_MABX_B.Operator_if = (uint8_T)(L4_MABX_B.DataTypeConversion_er & |
| 13523 | L4_MABX_P.Operator_BitMask_in); |
| 13524 | |
| 13525 | /* DataTypeConversion: '<S948>/DataType' */ |
| 13526 | L4_MABX_B.DataType_dg = L4_MABX_B.Operator_if; |
| 13527 | |
| 13528 | /* ArithShift: '<S940>/Shift_Arithmetic 2' */ |
| 13529 | L4_MABX_B.Shift_Arithmetic2_h = ldexp(L4_MABX_B.DataType_dg, (-3)); |
| 13530 | |
| 13531 | /* DataTypeConversion: '<S940>/Data Type Conversion5' */ |
| 13532 | L4_MABX_B.DataTypeConversion5_n = (L4_MABX_B.Shift_Arithmetic2_h != 0.0); |
| 13533 | |
| 13534 | /* Outputs for Enabled SubSystem: '<S951>/ACCS' incorporates: |
| 13535 | * EnablePort: '<S952>/Enable' |
| 13536 | */ |
| 13537 | if (L4_MABX_B.DataTypeConversion5_n) { |
| 13538 | /* S-Function (rti_commonblock): '<S952>/S-Function1' */ |
| 13539 | /* This comment workarounds a code generation problem */ |
| 13540 | |
| 13541 | /* dSPACE RTICAN TX Message Block: "ACCS" Id:418393572 */ |
| 13542 | { |
| 13543 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 13544 | |
| 13545 | Float32 delayTime = 0.0; |
| 13546 | |
| 13547 | /* ... Read status and timestamp info (previous message) */ |
| 13548 | can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]); |
| 13549 | |
| 13550 | /* Convert timestamp */ |
| 13551 | if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->processed) { |
| 13552 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->timestamp = |
| 13553 | rtk_dsts_time_to_simtime_convert |
| 13554 | (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->timestamp); |
| 13555 | } |
| 13556 | |
| 13557 | /* Messages with timestamp zero have been received in pause/stop state |
| 13558 | and must not be handled. |
| 13559 | */ |
| 13560 | if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->timestamp > 0.0) { |
| 13561 | L4_MABX_B.SFunction1_o1_il = (real_T) |
| 13562 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->processed; |
| 13563 | L4_MABX_B.SFunction1_o2_hc = (real_T) |
| 13564 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->timestamp; |
| 13565 | L4_MABX_B.SFunction1_o3_ft = (real_T) |
| 13566 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->deltatime; |
| 13567 | L4_MABX_B.SFunction1_o4_b = (real_T) |
| 13568 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->delaytime; |
| 13569 | } |
| 13570 | |
| 13571 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 13572 | { |
| 13573 | rtican_Signal_t CAN_Sgn; |
| 13574 | |
| 13575 | /* ...... "LongitudinalAccelerationExRange" (16|16, standard signal, unsigned int, little endian) */ |
| 13576 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13577 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion4_i - |
| 13578 | ( -320 ) ) / 0.01 + 0.5); |
| 13579 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 13580 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 13581 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte1; |
| 13582 | } |
| 13583 | |
| 13584 | /* mask unused bits with '1' */ |
| 13585 | CAN_Msg[0] |= 0xFF; |
| 13586 | CAN_Msg[1] |= 0xFF; |
| 13587 | CAN_Msg[4] |= 0xFF; |
| 13588 | CAN_Msg[5] |= 0xFF; |
| 13589 | CAN_Msg[6] |= 0xFF; |
| 13590 | CAN_Msg[7] |= 0xFF; |
| 13591 | |
| 13592 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 13593 | can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4], 8, |
| 13594 | &(CAN_Msg[0]), delayTime); |
| 13595 | } |
| 13596 | } |
| 13597 | |
| 13598 | /* End of Outputs for SubSystem: '<S951>/ACCS' */ |
| 13599 | |
| 13600 | /* S-Function (sfix_bitop): '<S945>/Operator' */ |
| 13601 | L4_MABX_B.Operator_e2 = (uint8_T)(L4_MABX_B.DataTypeConversion_er & |
| 13602 | L4_MABX_P.Operator_BitMask_k); |
| 13603 | |
| 13604 | /* DataTypeConversion: '<S945>/DataType' */ |
| 13605 | L4_MABX_B.DataType_e0 = L4_MABX_B.Operator_e2; |
| 13606 | |
| 13607 | /* S-Function (sfix_bitop): '<S946>/Operator' */ |
| 13608 | L4_MABX_B.Operator_fv = (uint8_T)(L4_MABX_B.DataTypeConversion_er & |
| 13609 | L4_MABX_P.Operator_BitMask_fo); |
| 13610 | |
| 13611 | /* DataTypeConversion: '<S946>/DataType' */ |
| 13612 | L4_MABX_B.DataType_b = L4_MABX_B.Operator_fv; |
| 13613 | |
| 13614 | /* S-Function (sfix_bitop): '<S947>/Operator' */ |
| 13615 | L4_MABX_B.Operator_gt = (uint8_T)(L4_MABX_B.DataTypeConversion_er & |
| 13616 | L4_MABX_P.Operator_BitMask_ij); |
| 13617 | |
| 13618 | /* DataTypeConversion: '<S947>/DataType' */ |
| 13619 | L4_MABX_B.DataType_g = L4_MABX_B.Operator_gt; |
| 13620 | |
| 13621 | /* S-Function (sfix_bitop): '<S949>/Operator' */ |
| 13622 | L4_MABX_B.Operator_cg = (uint8_T)(L4_MABX_B.DataTypeConversion_er & |
| 13623 | L4_MABX_P.Operator_BitMask_la); |
| 13624 | |
| 13625 | /* DataTypeConversion: '<S949>/DataType' */ |
| 13626 | L4_MABX_B.DataType_n = L4_MABX_B.Operator_cg; |
| 13627 | |
| 13628 | /* S-Function (sfix_bitop): '<S950>/Operator' */ |
| 13629 | L4_MABX_B.Operator_mr = (uint8_T)(L4_MABX_B.DataTypeConversion_er & |
| 13630 | L4_MABX_P.Operator_BitMask_h); |
| 13631 | |
| 13632 | /* DataTypeConversion: '<S950>/DataType' */ |
| 13633 | L4_MABX_B.DataType_p = L4_MABX_B.Operator_mr; |
| 13634 | |
| 13635 | /* DataTypeConversion: '<S940>/Data Type Conversion2' */ |
| 13636 | L4_MABX_B.DataTypeConversion2_kc = (L4_MABX_B.DataType_e0 != 0); |
| 13637 | |
| 13638 | /* ArithShift: '<S940>/Shift_Arithmetic ' */ |
| 13639 | L4_MABX_B.Shift_Arithmetic_p = ldexp(L4_MABX_B.DataType_b, (-1)); |
| 13640 | |
| 13641 | /* DataTypeConversion: '<S940>/Data Type Conversion3' */ |
| 13642 | L4_MABX_B.DataTypeConversion3_lb = (L4_MABX_B.Shift_Arithmetic_p != 0.0); |
| 13643 | |
| 13644 | /* ArithShift: '<S940>/Shift_Arithmetic 1' */ |
| 13645 | L4_MABX_B.Shift_Arithmetic1_p = ldexp(L4_MABX_B.DataType_g, (-2)); |
| 13646 | |
| 13647 | /* DataTypeConversion: '<S940>/Data Type Conversion4' */ |
| 13648 | L4_MABX_B.DataTypeConversion4_bp = (L4_MABX_B.Shift_Arithmetic1_p != 0.0); |
| 13649 | |
| 13650 | /* ArithShift: '<S940>/Shift_Arithmetic 3' */ |
| 13651 | L4_MABX_B.Shift_Arithmetic3_k = ldexp(L4_MABX_B.DataType_n, (-4)); |
| 13652 | |
| 13653 | /* DataTypeConversion: '<S940>/Data Type Conversion6' */ |
| 13654 | L4_MABX_B.DataTypeConversion6_gc = (L4_MABX_B.Shift_Arithmetic3_k != 0.0); |
| 13655 | |
| 13656 | /* ArithShift: '<S940>/Shift_Arithmetic 4' */ |
| 13657 | L4_MABX_B.Shift_Arithmetic4_n = ldexp(L4_MABX_B.DataType_p, (-5)); |
| 13658 | |
| 13659 | /* DataTypeConversion: '<S940>/Data Type Conversion7' */ |
| 13660 | L4_MABX_B.DataTypeConversion7_mp = (L4_MABX_B.Shift_Arithmetic4_n != 0.0); |
| 13661 | |
| 13662 | /* DataTypeConversion: '<S959>/Data Type Conversion1' */ |
| 13663 | L4_MABX_B.DataTypeConversion1_k = L4_MABX_B.SFunction1_o2_eg; |
| 13664 | |
| 13665 | /* DataTypeConversion: '<S959>/Data Type Conversion2' */ |
| 13666 | L4_MABX_B.DataTypeConversion2_d = L4_MABX_B.SFunction1_o3_lv; |
| 13667 | |
| 13668 | /* DataTypeConversion: '<S959>/Data Type Conversion3' */ |
| 13669 | L4_MABX_B.DataTypeConversion3_co = L4_MABX_B.SFunction1_o4_jq; |
| 13670 | |
| 13671 | /* DataTypeConversion: '<S959>/Data Type Conversion4' */ |
| 13672 | L4_MABX_B.DataTypeConversion4_e = L4_MABX_B.SFunction1_o1_j3; |
| 13673 | |
| 13674 | /* DataTypeConversion: '<S959>/Data Type Conversion5' */ |
| 13675 | L4_MABX_B.DataTypeConversion5_o = L4_MABX_B.SFunction1_o5_l; |
| 13676 | |
| 13677 | /* DataTypeConversion: '<S959>/Data Type Conversion6' */ |
| 13678 | L4_MABX_B.DataTypeConversion6_f = L4_MABX_B.SFunction1_o6_o; |
| 13679 | |
| 13680 | /* DataTypeConversion: '<S959>/Data Type Conversion7' */ |
| 13681 | L4_MABX_B.DataTypeConversion7_k = L4_MABX_B.SFunction1_o7_i3; |
| 13682 | |
| 13683 | /* DataTypeConversion: '<S959>/Data Type Conversion8' */ |
| 13684 | L4_MABX_B.DataTypeConversion8_d = L4_MABX_B.SFunction1_o8_e; |
| 13685 | |
| 13686 | /* DataTypeConversion: '<S941>/Data Type Conversion' incorporates: |
| 13687 | * Constant: '<S854>/CANT_EEC1_00_CHANNEL_APV' |
| 13688 | */ |
| 13689 | L4_MABX_B.DataTypeConversion_ig = (uint8_T) |
| 13690 | L4_MABX_P.CANT_EEC1_00_CHANNEL_APV_Value; |
| 13691 | |
| 13692 | /* S-Function (sfix_bitop): '<S956>/Operator' */ |
| 13693 | L4_MABX_B.Operator_os = (uint8_T)(L4_MABX_B.DataTypeConversion_ig & |
| 13694 | L4_MABX_P.Operator_BitMask_b1); |
| 13695 | |
| 13696 | /* DataTypeConversion: '<S956>/DataType' */ |
| 13697 | L4_MABX_B.DataType_np = L4_MABX_B.Operator_os; |
| 13698 | |
| 13699 | /* ArithShift: '<S941>/Shift_Arithmetic 2' */ |
| 13700 | L4_MABX_B.Shift_Arithmetic2_c = ldexp(L4_MABX_B.DataType_np, (-3)); |
| 13701 | |
| 13702 | /* DataTypeConversion: '<S941>/Data Type Conversion5' */ |
| 13703 | L4_MABX_B.DataTypeConversion5_h = (L4_MABX_B.Shift_Arithmetic2_c != 0.0); |
| 13704 | |
| 13705 | /* Outputs for Enabled SubSystem: '<S959>/EEC1_00' incorporates: |
| 13706 | * EnablePort: '<S961>/Enable' |
| 13707 | */ |
| 13708 | if (L4_MABX_B.DataTypeConversion5_h) { |
| 13709 | /* S-Function (rti_commonblock): '<S961>/S-Function1' */ |
| 13710 | /* This comment workarounds a code generation problem */ |
| 13711 | |
| 13712 | /* dSPACE RTICAN TX Message Block: "EEC1_00" Id:217056256 */ |
| 13713 | { |
| 13714 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 13715 | |
| 13716 | Float32 delayTime = 0.0; |
| 13717 | |
| 13718 | /* ... Read status and timestamp info (previous message) */ |
| 13719 | can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]); |
| 13720 | |
| 13721 | /* Convert timestamp */ |
| 13722 | if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->processed) { |
| 13723 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->timestamp = |
| 13724 | rtk_dsts_time_to_simtime_convert |
| 13725 | (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->timestamp); |
| 13726 | } |
| 13727 | |
| 13728 | /* Messages with timestamp zero have been received in pause/stop state |
| 13729 | and must not be handled. |
| 13730 | */ |
| 13731 | if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->timestamp > 0.0) { |
| 13732 | L4_MABX_B.SFunction1_o1_o = (real_T) |
| 13733 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->processed; |
| 13734 | L4_MABX_B.SFunction1_o2_di = (real_T) |
| 13735 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->timestamp; |
| 13736 | L4_MABX_B.SFunction1_o3_p4 = (real_T) |
| 13737 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->deltatime; |
| 13738 | L4_MABX_B.SFunction1_o4_i = (real_T) |
| 13739 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->delaytime; |
| 13740 | } |
| 13741 | |
| 13742 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 13743 | { |
| 13744 | rtican_Signal_t CAN_Sgn; |
| 13745 | |
| 13746 | /* ...... "SPN899_EngineTorqueMode" (0|4, standard signal, unsigned int, little endian) */ |
| 13747 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13748 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion4_e ) + |
| 13749 | 0.5); |
| 13750 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 13751 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 13752 | |
| 13753 | /* ...... "SPN4154_ActEngPercTorqueFrac" (4|4, standard signal, unsigned int, little endian) */ |
| 13754 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13755 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_k - ( 0 ) |
| 13756 | ) / 0.125 + 0.5); |
| 13757 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 13758 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 13759 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 13760 | |
| 13761 | /* ...... "SPN512_DrvrDemEngPercTrq" (8|8, standard signal, unsigned int, little endian) */ |
| 13762 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13763 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion2_d - ( -125 |
| 13764 | ) + 0.5); |
| 13765 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 13766 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 13767 | |
| 13768 | /* ...... "SPN513_ActEngPercTorque" (16|8, standard signal, unsigned int, little endian) */ |
| 13769 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13770 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion3_co - |
| 13771 | ( -125 ) + 0.5); |
| 13772 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 13773 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 13774 | |
| 13775 | /* ...... "SPN190_EngineSpeed" (24|16, standard signal, unsigned int, little endian) */ |
| 13776 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13777 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion5_o - ( 0 ) |
| 13778 | ) / 0.125 + 0.5); |
| 13779 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 13780 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 13781 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte1; |
| 13782 | |
| 13783 | /* ...... "SPN1483_SAOfCtrlDevForEngineCtrl" (40|8, standard signal, unsigned int, little endian) */ |
| 13784 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13785 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion6_f ) + |
| 13786 | 0.5); |
| 13787 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 13788 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 13789 | |
| 13790 | /* ...... "SPN1675_EngineStarterMode" (48|4, standard signal, unsigned int, little endian) */ |
| 13791 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13792 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion7_k ) + |
| 13793 | 0.5); |
| 13794 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 13795 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 13796 | |
| 13797 | /* ...... "SPN2432_EngDemPercTrq" (56|8, standard signal, unsigned int, little endian) */ |
| 13798 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13799 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion8_d - ( -125 |
| 13800 | ) + 0.5); |
| 13801 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 13802 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 13803 | } |
| 13804 | |
| 13805 | /* mask unused bits with '1' */ |
| 13806 | CAN_Msg[6] |= 0xF0; |
| 13807 | |
| 13808 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 13809 | can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400], 8, |
| 13810 | &(CAN_Msg[0]), delayTime); |
| 13811 | } |
| 13812 | } |
| 13813 | |
| 13814 | /* End of Outputs for SubSystem: '<S959>/EEC1_00' */ |
| 13815 | |
| 13816 | /* DataTypeConversion: '<S960>/Data Type Conversion1' */ |
| 13817 | L4_MABX_B.DataTypeConversion1_i = L4_MABX_B.SFunction1_o2_eg; |
| 13818 | |
| 13819 | /* DataTypeConversion: '<S960>/Data Type Conversion2' */ |
| 13820 | L4_MABX_B.DataTypeConversion2_eb = L4_MABX_B.SFunction1_o3_lv; |
| 13821 | |
| 13822 | /* DataTypeConversion: '<S960>/Data Type Conversion3' */ |
| 13823 | L4_MABX_B.DataTypeConversion3_h = L4_MABX_B.SFunction1_o4_jq; |
| 13824 | |
| 13825 | /* DataTypeConversion: '<S960>/Data Type Conversion4' */ |
| 13826 | L4_MABX_B.DataTypeConversion4_in = L4_MABX_B.SFunction1_o1_j3; |
| 13827 | |
| 13828 | /* DataTypeConversion: '<S960>/Data Type Conversion5' */ |
| 13829 | L4_MABX_B.DataTypeConversion5_b = L4_MABX_B.SFunction1_o5_l; |
| 13830 | |
| 13831 | /* DataTypeConversion: '<S960>/Data Type Conversion6' */ |
| 13832 | L4_MABX_B.DataTypeConversion6_k = L4_MABX_B.SFunction1_o6_o; |
| 13833 | |
| 13834 | /* DataTypeConversion: '<S960>/Data Type Conversion7' */ |
| 13835 | L4_MABX_B.DataTypeConversion7_c = L4_MABX_B.SFunction1_o7_i3; |
| 13836 | |
| 13837 | /* DataTypeConversion: '<S960>/Data Type Conversion8' */ |
| 13838 | L4_MABX_B.DataTypeConversion8_k = L4_MABX_B.SFunction1_o8_e; |
| 13839 | |
| 13840 | /* S-Function (sfix_bitop): '<S957>/Operator' */ |
| 13841 | L4_MABX_B.Operator_dh = (uint8_T)(L4_MABX_B.DataTypeConversion_ig & |
| 13842 | L4_MABX_P.Operator_BitMask_gb); |
| 13843 | |
| 13844 | /* DataTypeConversion: '<S957>/DataType' */ |
| 13845 | L4_MABX_B.DataType_i = L4_MABX_B.Operator_dh; |
| 13846 | |
| 13847 | /* ArithShift: '<S941>/Shift_Arithmetic 3' */ |
| 13848 | L4_MABX_B.Shift_Arithmetic3_f = ldexp(L4_MABX_B.DataType_i, (-4)); |
| 13849 | |
| 13850 | /* DataTypeConversion: '<S941>/Data Type Conversion6' */ |
| 13851 | L4_MABX_B.DataTypeConversion6_c4 = (L4_MABX_B.Shift_Arithmetic3_f != 0.0); |
| 13852 | |
| 13853 | /* Outputs for Enabled SubSystem: '<S960>/EEC1_00' incorporates: |
| 13854 | * EnablePort: '<S962>/Enable' |
| 13855 | */ |
| 13856 | if (L4_MABX_B.DataTypeConversion6_c4) { |
| 13857 | /* S-Function (rti_commonblock): '<S962>/S-Function1' */ |
| 13858 | /* This comment workarounds a code generation problem */ |
| 13859 | |
| 13860 | /* dSPACE RTICAN TX Message Block: "EEC1_00" Id:217056256 */ |
| 13861 | { |
| 13862 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 13863 | |
| 13864 | Float32 delayTime = 0.0; |
| 13865 | |
| 13866 | /* ... Read status and timestamp info (previous message) */ |
| 13867 | can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]); |
| 13868 | |
| 13869 | /* Convert timestamp */ |
| 13870 | if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->processed) { |
| 13871 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->timestamp = |
| 13872 | rtk_dsts_time_to_simtime_convert |
| 13873 | (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->timestamp); |
| 13874 | } |
| 13875 | |
| 13876 | /* Messages with timestamp zero have been received in pause/stop state |
| 13877 | and must not be handled. |
| 13878 | */ |
| 13879 | if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->timestamp > 0.0) { |
| 13880 | L4_MABX_B.SFunction1_o1_a = (real_T) |
| 13881 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->processed; |
| 13882 | L4_MABX_B.SFunction1_o2_co = (real_T) |
| 13883 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->timestamp; |
| 13884 | L4_MABX_B.SFunction1_o3_f1 = (real_T) |
| 13885 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->deltatime; |
| 13886 | L4_MABX_B.SFunction1_o4_jm = (real_T) |
| 13887 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->delaytime; |
| 13888 | } |
| 13889 | |
| 13890 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 13891 | { |
| 13892 | rtican_Signal_t CAN_Sgn; |
| 13893 | |
| 13894 | /* ...... "SPN899_EngineTorqueMode" (0|4, standard signal, unsigned int, little endian) */ |
| 13895 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13896 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion4_in ) + |
| 13897 | 0.5); |
| 13898 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 13899 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 13900 | |
| 13901 | /* ...... "SPN4154_ActEngPercTorqueFrac" (4|4, standard signal, unsigned int, little endian) */ |
| 13902 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13903 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_i - ( 0 ) |
| 13904 | ) / 0.125 + 0.5); |
| 13905 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 13906 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 13907 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 13908 | |
| 13909 | /* ...... "SPN512_DrvrDemEngPercTrq" (8|8, standard signal, unsigned int, little endian) */ |
| 13910 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13911 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion2_eb - |
| 13912 | ( -125 ) + 0.5); |
| 13913 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 13914 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 13915 | |
| 13916 | /* ...... "SPN513_ActEngPercTorque" (16|8, standard signal, unsigned int, little endian) */ |
| 13917 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13918 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion3_h - ( -125 |
| 13919 | ) + 0.5); |
| 13920 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 13921 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 13922 | |
| 13923 | /* ...... "SPN190_EngineSpeed" (24|16, standard signal, unsigned int, little endian) */ |
| 13924 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13925 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion5_b - ( 0 ) |
| 13926 | ) / 0.125 + 0.5); |
| 13927 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 13928 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 13929 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte1; |
| 13930 | |
| 13931 | /* ...... "SPN1483_SAOfCtrlDevForEngineCtrl" (40|8, standard signal, unsigned int, little endian) */ |
| 13932 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13933 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion6_k ) + |
| 13934 | 0.5); |
| 13935 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 13936 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 13937 | |
| 13938 | /* ...... "SPN1675_EngineStarterMode" (48|4, standard signal, unsigned int, little endian) */ |
| 13939 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13940 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion7_c ) + |
| 13941 | 0.5); |
| 13942 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 13943 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 13944 | |
| 13945 | /* ...... "SPN2432_EngDemPercTrq" (56|8, standard signal, unsigned int, little endian) */ |
| 13946 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 13947 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion8_k - ( -125 |
| 13948 | ) + 0.5); |
| 13949 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 13950 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 13951 | } |
| 13952 | |
| 13953 | /* mask unused bits with '1' */ |
| 13954 | CAN_Msg[6] |= 0xF0; |
| 13955 | |
| 13956 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 13957 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400], 8, |
| 13958 | &(CAN_Msg[0]), delayTime); |
| 13959 | } |
| 13960 | } |
| 13961 | |
| 13962 | /* End of Outputs for SubSystem: '<S960>/EEC1_00' */ |
| 13963 | |
| 13964 | /* S-Function (sfix_bitop): '<S953>/Operator' */ |
| 13965 | L4_MABX_B.Operator_mz = (uint8_T)(L4_MABX_B.DataTypeConversion_ig & |
| 13966 | L4_MABX_P.Operator_BitMask_b4); |
| 13967 | |
| 13968 | /* DataTypeConversion: '<S953>/DataType' */ |
| 13969 | L4_MABX_B.DataType_f1 = L4_MABX_B.Operator_mz; |
| 13970 | |
| 13971 | /* S-Function (sfix_bitop): '<S954>/Operator' */ |
| 13972 | L4_MABX_B.Operator_hc = (uint8_T)(L4_MABX_B.DataTypeConversion_ig & |
| 13973 | L4_MABX_P.Operator_BitMask_og); |
| 13974 | |
| 13975 | /* DataTypeConversion: '<S954>/DataType' */ |
| 13976 | L4_MABX_B.DataType_p4 = L4_MABX_B.Operator_hc; |
| 13977 | |
| 13978 | /* S-Function (sfix_bitop): '<S955>/Operator' */ |
| 13979 | L4_MABX_B.Operator_n2 = (uint8_T)(L4_MABX_B.DataTypeConversion_ig & |
| 13980 | L4_MABX_P.Operator_BitMask_n); |
| 13981 | |
| 13982 | /* DataTypeConversion: '<S955>/DataType' */ |
| 13983 | L4_MABX_B.DataType_gd = L4_MABX_B.Operator_n2; |
| 13984 | |
| 13985 | /* S-Function (sfix_bitop): '<S958>/Operator' */ |
| 13986 | L4_MABX_B.Operator_h0 = (uint8_T)(L4_MABX_B.DataTypeConversion_ig & |
| 13987 | L4_MABX_P.Operator_BitMask_fz); |
| 13988 | |
| 13989 | /* DataTypeConversion: '<S958>/DataType' */ |
| 13990 | L4_MABX_B.DataType_l = L4_MABX_B.Operator_h0; |
| 13991 | |
| 13992 | /* DataTypeConversion: '<S941>/Data Type Conversion2' */ |
| 13993 | L4_MABX_B.DataTypeConversion2_bz = (L4_MABX_B.DataType_f1 != 0); |
| 13994 | |
| 13995 | /* ArithShift: '<S941>/Shift_Arithmetic ' */ |
| 13996 | L4_MABX_B.Shift_Arithmetic_pe = ldexp(L4_MABX_B.DataType_p4, (-1)); |
| 13997 | |
| 13998 | /* DataTypeConversion: '<S941>/Data Type Conversion3' */ |
| 13999 | L4_MABX_B.DataTypeConversion3_lo = (L4_MABX_B.Shift_Arithmetic_pe != 0.0); |
| 14000 | |
| 14001 | /* ArithShift: '<S941>/Shift_Arithmetic 1' */ |
| 14002 | L4_MABX_B.Shift_Arithmetic1_l = ldexp(L4_MABX_B.DataType_gd, (-2)); |
| 14003 | |
| 14004 | /* DataTypeConversion: '<S941>/Data Type Conversion4' */ |
| 14005 | L4_MABX_B.DataTypeConversion4_g = (L4_MABX_B.Shift_Arithmetic1_l != 0.0); |
| 14006 | |
| 14007 | /* ArithShift: '<S941>/Shift_Arithmetic 4' */ |
| 14008 | L4_MABX_B.Shift_Arithmetic4_k = ldexp(L4_MABX_B.DataType_l, (-5)); |
| 14009 | |
| 14010 | /* DataTypeConversion: '<S941>/Data Type Conversion7' */ |
| 14011 | L4_MABX_B.DataTypeConversion7_bc = (L4_MABX_B.Shift_Arithmetic4_k != 0.0); |
| 14012 | |
| 14013 | /* DataTypeConversion: '<S944>/Data Type Conversion' */ |
| 14014 | L4_MABX_B.DataTypeConversion_ij = AutonomousOutputEnabled; |
| 14015 | |
| 14016 | /* Switch: '<S978>/Switch' incorporates: |
| 14017 | * Constant: '<S978>/Constant' |
| 14018 | * Constant: '<S978>/Constant1' |
| 14019 | */ |
| 14020 | if (L4_MABX_B.DataTypeConversion_ij != 0) { |
| 14021 | L4_MABX_B.Switch_gf = L4_MABX_P.Constant_Value_i1; |
| 14022 | } else { |
| 14023 | L4_MABX_B.Switch_gf = L4_MABX_P.Constant1_Value_ip; |
| 14024 | } |
| 14025 | |
| 14026 | /* End of Switch: '<S978>/Switch' */ |
| 14027 | |
| 14028 | /* DataTypeConversion: '<S976>/Data Type Conversion' */ |
| 14029 | L4_MABX_B.DataTypeConversion_pa = L4_MABX_B.Switch_gf; |
| 14030 | |
| 14031 | /* RelationalOperator: '<S995>/Operator' incorporates: |
| 14032 | * Constant: '<S977>/Constant' |
| 14033 | * Constant: '<S977>/Constant6' |
| 14034 | */ |
| 14035 | L4_MABX_B.Operator_al = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV == |
| 14036 | L4_MABX_P.Constant_Value_ey); |
| 14037 | |
| 14038 | /* Outputs for Enabled SubSystem: '<S977>/DEFAULT_TRQ_CTRL_MODE' */ |
| 14039 | L4_MABX_ALL_CTRL_DISABLED(L4_MABX_B.Operator_al, &L4_MABX_B.Merge, |
| 14040 | &L4_MABX_P.DEFAULT_TRQ_CTRL_MODE); |
| 14041 | |
| 14042 | /* End of Outputs for SubSystem: '<S977>/DEFAULT_TRQ_CTRL_MODE' */ |
| 14043 | |
| 14044 | /* Switch: '<S994>/Switch' incorporates: |
| 14045 | * Constant: '<S994>/zero' |
| 14046 | */ |
| 14047 | if (L4_MABX_B.DataTypeConversion_ij != 0) { |
| 14048 | /* MultiPortSwitch: '<S994>/Multiport_Switch' incorporates: |
| 14049 | * Constant: '<S994>/Constant1' |
| 14050 | * Constant: '<S994>/Constant7' |
| 14051 | */ |
| 14052 | switch (PROPB_REAX_1_E4_DES_POS_SIG_SRC_APV) { |
| 14053 | case ENUM_STEERING_POS_SIGNAL_SOURCE_T_SW_EMULATION: |
| 14054 | L4_MABX_B.Multiport_Switch = PROPB_REAX_1_E4_DESIRED_POSITION_APV; |
| 14055 | break; |
| 14056 | |
| 14057 | case ENUM_STEERING_POS_SIGNAL_SOURCE_T_ESTIMATION: |
| 14058 | L4_MABX_B.Multiport_Switch = L4_MABX_B.Subtract_c1; |
| 14059 | break; |
| 14060 | |
| 14061 | default: |
| 14062 | L4_MABX_B.Multiport_Switch = PROPB_REAX_1_E4_DESIRED_POSITION_APV; |
| 14063 | break; |
| 14064 | } |
| 14065 | |
| 14066 | /* End of MultiPortSwitch: '<S994>/Multiport_Switch' */ |
| 14067 | L4_MABX_B.Switch_k = L4_MABX_B.Multiport_Switch; |
| 14068 | } else { |
| 14069 | L4_MABX_B.Switch_k = L4_MABX_P.zero_Value_k; |
| 14070 | } |
| 14071 | |
| 14072 | /* End of Switch: '<S994>/Switch' */ |
| 14073 | |
| 14074 | /* RelationalOperator: '<S1004>/Operator_MX' incorporates: |
| 14075 | * Constant: '<S1004>/MX' |
| 14076 | */ |
| 14077 | L4_MABX_B.Operator_MX = (L4_MABX_B.Switch_k > L4_MABX_P.MX_Value); |
| 14078 | |
| 14079 | /* RelationalOperator: '<S1004>/Operator_MN' incorporates: |
| 14080 | * Constant: '<S1004>/MN' |
| 14081 | */ |
| 14082 | L4_MABX_B.Operator_MN = (L4_MABX_B.Switch_k < L4_MABX_P.MN_Value); |
| 14083 | |
| 14084 | /* Switch: '<S1004>/Switch2' incorporates: |
| 14085 | * Constant: '<S1004>/MX' |
| 14086 | * Switch: '<S1004>/Switch1' |
| 14087 | */ |
| 14088 | if (L4_MABX_B.Operator_MX) { |
| 14089 | L4_MABX_B.Switch2 = L4_MABX_P.MX_Value; |
| 14090 | } else { |
| 14091 | if (L4_MABX_B.Operator_MN) { |
| 14092 | /* Switch: '<S1004>/Switch1' incorporates: |
| 14093 | * Constant: '<S1004>/MN' |
| 14094 | */ |
| 14095 | L4_MABX_B.Switch1 = L4_MABX_P.MN_Value; |
| 14096 | } else { |
| 14097 | /* Switch: '<S1004>/Switch1' */ |
| 14098 | L4_MABX_B.Switch1 = L4_MABX_B.Switch_k; |
| 14099 | } |
| 14100 | |
| 14101 | L4_MABX_B.Switch2 = L4_MABX_B.Switch1; |
| 14102 | } |
| 14103 | |
| 14104 | /* End of Switch: '<S1004>/Switch2' */ |
| 14105 | |
| 14106 | /* DataTypeConversion: '<S1004>/DataType' */ |
| 14107 | L4_MABX_B.DataType_kg = L4_MABX_B.Switch2; |
| 14108 | |
| 14109 | /* RelationalOperator: '<S996>/Operator' incorporates: |
| 14110 | * Constant: '<S977>/Constant1' |
| 14111 | * Constant: '<S977>/Constant6' |
| 14112 | */ |
| 14113 | L4_MABX_B.Operator_iw = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV == |
| 14114 | L4_MABX_P.Constant1_Value_kq); |
| 14115 | |
| 14116 | /* Outputs for Enabled SubSystem: '<S977>/POSITION_CONTROL_MODE' incorporates: |
| 14117 | * EnablePort: '<S1005>/Enable' |
| 14118 | */ |
| 14119 | if (L4_MABX_B.Operator_iw) { |
| 14120 | /* Product: '<S1005>/Product' incorporates: |
| 14121 | * Constant: '<S1005>/Constant' |
| 14122 | */ |
| 14123 | L4_MABX_B.Product = L4_MABX_B.DataType_kg * L4_MABX_P.Constant_Value_la; |
| 14124 | |
| 14125 | /* DataTypeConversion: '<S1005>/Data Type Conversion' */ |
| 14126 | PositionFinalLimited = floor(L4_MABX_B.Product); |
| 14127 | if (PositionFinalLimited < 2.147483648E+9) { |
| 14128 | if (PositionFinalLimited >= -2.147483648E+9) { |
| 14129 | i = (int32_T)PositionFinalLimited; |
| 14130 | } else { |
| 14131 | i = MIN_int32_T; |
| 14132 | } |
| 14133 | } else { |
| 14134 | i = MAX_int32_T; |
| 14135 | } |
| 14136 | |
| 14137 | L4_MABX_B.Merge = i; |
| 14138 | |
| 14139 | /* End of DataTypeConversion: '<S1005>/Data Type Conversion' */ |
| 14140 | } |
| 14141 | |
| 14142 | /* End of Outputs for SubSystem: '<S977>/POSITION_CONTROL_MODE' */ |
| 14143 | |
| 14144 | /* RelationalOperator: '<S997>/Operator' incorporates: |
| 14145 | * Constant: '<S977>/Constant2' |
| 14146 | * Constant: '<S977>/Constant6' |
| 14147 | */ |
| 14148 | L4_MABX_B.Operator_gtp = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV == |
| 14149 | L4_MABX_P.Constant2_Value_gu); |
| 14150 | |
| 14151 | /* Outputs for Enabled SubSystem: '<S977>/EXT_TRQ_CTRL_MODE_A' */ |
| 14152 | L4_MABX_ALL_CTRL_DISABLED(L4_MABX_B.Operator_gtp, &L4_MABX_B.Merge, |
| 14153 | &L4_MABX_P.EXT_TRQ_CTRL_MODE_A); |
| 14154 | |
| 14155 | /* End of Outputs for SubSystem: '<S977>/EXT_TRQ_CTRL_MODE_A' */ |
| 14156 | |
| 14157 | /* RelationalOperator: '<S998>/Operator' incorporates: |
| 14158 | * Constant: '<S977>/Constant3' |
| 14159 | * Constant: '<S977>/Constant6' |
| 14160 | */ |
| 14161 | L4_MABX_B.Operator_fr = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV == |
| 14162 | L4_MABX_P.Constant3_Value_k); |
| 14163 | |
| 14164 | /* Outputs for Enabled SubSystem: '<S977>/ALL_CTRL_DISABLED' */ |
| 14165 | L4_MABX_ALL_CTRL_DISABLED(L4_MABX_B.Operator_fr, &L4_MABX_B.Merge, |
| 14166 | &L4_MABX_P.ALL_CTRL_DISABLED); |
| 14167 | |
| 14168 | /* End of Outputs for SubSystem: '<S977>/ALL_CTRL_DISABLED' */ |
| 14169 | |
| 14170 | /* RelationalOperator: '<S999>/Operator' incorporates: |
| 14171 | * Constant: '<S977>/Constant4' |
| 14172 | * Constant: '<S977>/Constant6' |
| 14173 | */ |
| 14174 | L4_MABX_B.Operator_llo = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV == |
| 14175 | L4_MABX_P.Constant4_Value_ou); |
| 14176 | |
| 14177 | /* Outputs for Enabled SubSystem: '<S977>/EXT_TRQ_CTRL_MODE_B' */ |
| 14178 | L4_MABX_ALL_CTRL_DISABLED(L4_MABX_B.Operator_llo, &L4_MABX_B.Merge, |
| 14179 | &L4_MABX_P.EXT_TRQ_CTRL_MODE_B); |
| 14180 | |
| 14181 | /* End of Outputs for SubSystem: '<S977>/EXT_TRQ_CTRL_MODE_B' */ |
| 14182 | |
| 14183 | /* RelationalOperator: '<S1000>/Operator' incorporates: |
| 14184 | * Constant: '<S977>/Constant5' |
| 14185 | * Constant: '<S977>/Constant6' |
| 14186 | */ |
| 14187 | L4_MABX_B.Operator_lf = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV == |
| 14188 | L4_MABX_P.Constant5_Value_e); |
| 14189 | |
| 14190 | /* Outputs for Enabled SubSystem: '<S977>/EXT_TRQ_CTRL_MODE_C' */ |
| 14191 | L4_MABX_ALL_CTRL_DISABLED(L4_MABX_B.Operator_lf, &L4_MABX_B.Merge, |
| 14192 | &L4_MABX_P.EXT_TRQ_CTRL_MODE_C); |
| 14193 | |
| 14194 | /* End of Outputs for SubSystem: '<S977>/EXT_TRQ_CTRL_MODE_C' */ |
| 14195 | |
| 14196 | /* DataTypeConversion: '<S976>/Data Type Conversion2' */ |
| 14197 | L4_MABX_B.DataTypeConversion2_a = (uint32_T)L4_MABX_B.Merge; |
| 14198 | |
| 14199 | /* S-Function (sfix_bitop): '<S981>/Operator' */ |
| 14200 | L4_MABX_B.Operator_h = L4_MABX_B.DataTypeConversion2_a & |
| 14201 | L4_MABX_P.Operator_BitMask_l4; |
| 14202 | |
| 14203 | /* DataTypeConversion: '<S981>/DataType' */ |
| 14204 | tmp = L4_MABX_B.Operator_h; |
| 14205 | if (tmp > 255U) { |
| 14206 | tmp = 255U; |
| 14207 | } |
| 14208 | |
| 14209 | L4_MABX_B.DataType_pi = (uint8_T)tmp; |
| 14210 | |
| 14211 | /* End of DataTypeConversion: '<S981>/DataType' */ |
| 14212 | |
| 14213 | /* S-Function (sfix_bitop): '<S982>/Operator' */ |
| 14214 | L4_MABX_B.Operator_g = L4_MABX_B.DataTypeConversion2_a & |
| 14215 | L4_MABX_P.Operator_BitMask_fr; |
| 14216 | |
| 14217 | /* DataTypeConversion: '<S982>/DataType' */ |
| 14218 | tmp = L4_MABX_B.Operator_g; |
| 14219 | if (tmp > 65535U) { |
| 14220 | tmp = 65535U; |
| 14221 | } |
| 14222 | |
| 14223 | L4_MABX_B.DataType_nli = (uint16_T)tmp; |
| 14224 | |
| 14225 | /* End of DataTypeConversion: '<S982>/DataType' */ |
| 14226 | |
| 14227 | /* ArithShift: '<S976>/Shift_Arithmetic ' */ |
| 14228 | L4_MABX_B.Shift_Arithmetic_cf = (uint16_T)((uint32_T)L4_MABX_B.DataType_nli >> |
| 14229 | 8); |
| 14230 | |
| 14231 | /* DataTypeConversion: '<S976>/Data Type Conversion4' */ |
| 14232 | tmp_0 = L4_MABX_B.Shift_Arithmetic_cf; |
| 14233 | if (tmp_0 > 255) { |
| 14234 | tmp_0 = 255U; |
| 14235 | } |
| 14236 | |
| 14237 | L4_MABX_B.DataTypeConversion4_pt = (uint8_T)tmp_0; |
| 14238 | |
| 14239 | /* End of DataTypeConversion: '<S976>/Data Type Conversion4' */ |
| 14240 | |
| 14241 | /* S-Function (sfix_bitop): '<S983>/Operator' */ |
| 14242 | L4_MABX_B.Operator_k = L4_MABX_B.DataTypeConversion2_a & |
| 14243 | L4_MABX_P.Operator_BitMask_as; |
| 14244 | |
| 14245 | /* DataTypeConversion: '<S983>/DataType' */ |
| 14246 | L4_MABX_B.DataType_fj = L4_MABX_B.Operator_k; |
| 14247 | |
| 14248 | /* ArithShift: '<S976>/Shift_Arithmetic 1' */ |
| 14249 | L4_MABX_B.Shift_Arithmetic1_g = L4_MABX_B.DataType_fj >> 16; |
| 14250 | |
| 14251 | /* DataTypeConversion: '<S976>/Data Type Conversion5' */ |
| 14252 | tmp = L4_MABX_B.Shift_Arithmetic1_g; |
| 14253 | if (tmp > 255U) { |
| 14254 | tmp = 255U; |
| 14255 | } |
| 14256 | |
| 14257 | L4_MABX_B.DataTypeConversion5_k1 = (uint8_T)tmp; |
| 14258 | |
| 14259 | /* End of DataTypeConversion: '<S976>/Data Type Conversion5' */ |
| 14260 | |
| 14261 | /* S-Function (sfix_bitop): '<S984>/Operator' */ |
| 14262 | L4_MABX_B.Operator_i = L4_MABX_B.DataTypeConversion2_a & |
| 14263 | L4_MABX_P.Operator_BitMask_ky; |
| 14264 | |
| 14265 | /* DataTypeConversion: '<S984>/DataType' */ |
| 14266 | L4_MABX_B.DataType_jq = L4_MABX_B.Operator_i; |
| 14267 | |
| 14268 | /* ArithShift: '<S976>/Shift_Arithmetic 2' */ |
| 14269 | L4_MABX_B.Shift_Arithmetic2_g = L4_MABX_B.DataType_jq >> 24; |
| 14270 | |
| 14271 | /* DataTypeConversion: '<S976>/Data Type Conversion6' */ |
| 14272 | tmp = L4_MABX_B.Shift_Arithmetic2_g; |
| 14273 | if (tmp > 255U) { |
| 14274 | tmp = 255U; |
| 14275 | } |
| 14276 | |
| 14277 | L4_MABX_B.DataTypeConversion6_ml2 = (uint8_T)tmp; |
| 14278 | |
| 14279 | /* End of DataTypeConversion: '<S976>/Data Type Conversion6' */ |
| 14280 | |
| 14281 | /* Reshape: '<S1006>/Reshape' incorporates: |
| 14282 | * Constant: '<S1006>/Constant' |
| 14283 | */ |
| 14284 | for (i = 0; i < 16; i++) { |
| 14285 | L4_MABX_B.Reshape_i[i] = L4_MABX_P.Repeating_Sequence_Stair_OutV_a[i]; |
| 14286 | } |
| 14287 | |
| 14288 | /* End of Reshape: '<S1006>/Reshape' */ |
| 14289 | |
| 14290 | /* UnitDelay: '<S1006>/Unit_Delay' */ |
| 14291 | L4_MABX_B.Unit_Delay_ep = L4_MABX_DW.Unit_Delay_DSTATE_lb; |
| 14292 | |
| 14293 | /* UnitDelay: '<S1007>/Unit Delay' */ |
| 14294 | L4_MABX_B.UnitDelay_h = L4_MABX_DW.UnitDelay_DSTATE_bi; |
| 14295 | |
| 14296 | /* Switch: '<S1010>/Switch1' incorporates: |
| 14297 | * Constant: '<S1007>/E' |
| 14298 | * Constant: '<S1007>/IV' |
| 14299 | * Switch: '<S1009>/Switch1' |
| 14300 | */ |
| 14301 | if (L4_MABX_B.Unit_Delay_ep) { |
| 14302 | L4_MABX_B.Switch1_b = L4_MABX_P.IV_Value_i; |
| 14303 | } else { |
| 14304 | if (L4_MABX_P.E_Value_p) { |
| 14305 | /* Sum: '<S1007>/Subtract' incorporates: |
| 14306 | * Constant: '<S1007>/Constant' |
| 14307 | * Switch: '<S1009>/Switch1' |
| 14308 | */ |
| 14309 | q0 = L4_MABX_P.Constant_Value_cu; |
| 14310 | tmp = q0 + L4_MABX_B.UnitDelay_h; |
| 14311 | if (tmp < q0) { |
| 14312 | tmp = MAX_uint32_T; |
| 14313 | } |
| 14314 | |
| 14315 | L4_MABX_B.Subtract_i3 = tmp; |
| 14316 | |
| 14317 | /* End of Sum: '<S1007>/Subtract' */ |
| 14318 | |
| 14319 | /* Switch: '<S1009>/Switch1' */ |
| 14320 | L4_MABX_B.Switch1_mr = L4_MABX_B.Subtract_i3; |
| 14321 | } else { |
| 14322 | /* Switch: '<S1009>/Switch1' */ |
| 14323 | L4_MABX_B.Switch1_mr = L4_MABX_B.UnitDelay_h; |
| 14324 | } |
| 14325 | |
| 14326 | L4_MABX_B.Switch1_b = L4_MABX_B.Switch1_mr; |
| 14327 | } |
| 14328 | |
| 14329 | /* End of Switch: '<S1010>/Switch1' */ |
| 14330 | |
| 14331 | /* Selector: '<S1006>/Selector' */ |
| 14332 | L4_MABX_B.Selector_d = L4_MABX_B.Reshape_i[(int32_T)L4_MABX_B.Switch1_b - 1]; |
| 14333 | |
| 14334 | /* DataTypeConversion: '<S976>/Data Type Conversion1' */ |
| 14335 | L4_MABX_B.DataTypeConversion1_je = L4_MABX_B.Selector_d; |
| 14336 | |
| 14337 | /* S-Function (sfix_bitop): '<S989>/Operator' */ |
| 14338 | L4_MABX_B.Operator_nk = (uint8_T)(L4_MABX_B.DataTypeConversion1_je & |
| 14339 | L4_MABX_P.Operator_BitMask_js); |
| 14340 | |
| 14341 | /* DataTypeConversion: '<S989>/DataType' */ |
| 14342 | L4_MABX_B.DataType_bv = L4_MABX_B.Operator_nk; |
| 14343 | |
| 14344 | /* DataTypeConversion: '<S975>/Data Type Conversion' incorporates: |
| 14345 | * Constant: '<S975>/Priority' |
| 14346 | */ |
| 14347 | L4_MABX_B.DataTypeConversion_c = L4_MABX_P.Priority_Value_c; |
| 14348 | |
| 14349 | /* ArithShift: '<S975>/Shift_Arithmetic ' */ |
| 14350 | L4_MABX_B.Shift_Arithmetic_o = L4_MABX_B.DataTypeConversion_c << 26; |
| 14351 | |
| 14352 | /* DataTypeConversion: '<S975>/Data Type Conversion1' incorporates: |
| 14353 | * Constant: '<S975>/ExtendedDataPage' |
| 14354 | */ |
| 14355 | L4_MABX_B.DataTypeConversion1_fw = L4_MABX_P.ExtendedDataPage_Value_p; |
| 14356 | |
| 14357 | /* ArithShift: '<S975>/Shift_Arithmetic 1' */ |
| 14358 | L4_MABX_B.Shift_Arithmetic1_ll = L4_MABX_B.DataTypeConversion1_fw << 25; |
| 14359 | |
| 14360 | /* DataTypeConversion: '<S975>/Data Type Conversion2' incorporates: |
| 14361 | * Constant: '<S975>/DataPage' |
| 14362 | */ |
| 14363 | L4_MABX_B.DataTypeConversion2_f = L4_MABX_P.DataPage_Value_m; |
| 14364 | |
| 14365 | /* ArithShift: '<S975>/Shift_Arithmetic 2' */ |
| 14366 | L4_MABX_B.Shift_Arithmetic2_p = L4_MABX_B.DataTypeConversion2_f << 24; |
| 14367 | |
| 14368 | /* DataTypeConversion: '<S975>/Data Type Conversion3' incorporates: |
| 14369 | * Constant: '<S975>/PDUFormat' |
| 14370 | */ |
| 14371 | L4_MABX_B.DataTypeConversion3_i = L4_MABX_P.PDUFormat_Value_m; |
| 14372 | |
| 14373 | /* ArithShift: '<S975>/Shift_Arithmetic 3' */ |
| 14374 | L4_MABX_B.Shift_Arithmetic3_j = L4_MABX_B.DataTypeConversion3_i << 16; |
| 14375 | |
| 14376 | /* DataTypeConversion: '<S975>/Data Type Conversion4' incorporates: |
| 14377 | * Constant: '<S975>/PDUSpecific' |
| 14378 | */ |
| 14379 | L4_MABX_B.DataTypeConversion4_a = L4_MABX_P.PDUSpecific_Value_j; |
| 14380 | |
| 14381 | /* ArithShift: '<S975>/Shift_Arithmetic 4' */ |
| 14382 | L4_MABX_B.Shift_Arithmetic4_h = L4_MABX_B.DataTypeConversion4_a << 8; |
| 14383 | |
| 14384 | /* DataTypeConversion: '<S975>/Data Type Conversion5' incorporates: |
| 14385 | * Constant: '<S975>/SourceAddress' |
| 14386 | */ |
| 14387 | L4_MABX_B.DataTypeConversion5_m = L4_MABX_P.SourceAddress_Value_a; |
| 14388 | |
| 14389 | /* S-Function (sfix_bitop): '<S980>/Operator' */ |
| 14390 | L4_MABX_B.Operator_ip = L4_MABX_B.Shift_Arithmetic_o | |
| 14391 | L4_MABX_B.Shift_Arithmetic1_ll | L4_MABX_B.Shift_Arithmetic2_p | |
| 14392 | L4_MABX_B.Shift_Arithmetic3_j | L4_MABX_B.Shift_Arithmetic4_h | |
| 14393 | L4_MABX_B.DataTypeConversion5_m; |
| 14394 | |
| 14395 | /* DataTypeConversion: '<S980>/DataType' */ |
| 14396 | L4_MABX_B.DataType_e = L4_MABX_B.Operator_ip; |
| 14397 | |
| 14398 | /* DataTypeConversion: '<S976>/Data Type Conversion3' */ |
| 14399 | L4_MABX_B.DataTypeConversion3_hj = L4_MABX_B.DataType_e; |
| 14400 | |
| 14401 | /* S-Function (sfix_bitop): '<S985>/Operator' */ |
| 14402 | L4_MABX_B.Operator_o = L4_MABX_B.DataTypeConversion3_hj & |
| 14403 | L4_MABX_P.Operator_BitMask_hu; |
| 14404 | |
| 14405 | /* DataTypeConversion: '<S985>/DataType' */ |
| 14406 | tmp = L4_MABX_B.Operator_o; |
| 14407 | if (tmp > 255U) { |
| 14408 | tmp = 255U; |
| 14409 | } |
| 14410 | |
| 14411 | L4_MABX_B.DataType_iy = (uint8_T)tmp; |
| 14412 | |
| 14413 | /* End of DataTypeConversion: '<S985>/DataType' */ |
| 14414 | |
| 14415 | /* S-Function (sfix_bitop): '<S986>/Operator' */ |
| 14416 | L4_MABX_B.Operator_b = L4_MABX_B.DataTypeConversion3_hj & |
| 14417 | L4_MABX_P.Operator_BitMask_m3; |
| 14418 | |
| 14419 | /* DataTypeConversion: '<S986>/DataType' */ |
| 14420 | tmp = L4_MABX_B.Operator_b; |
| 14421 | if (tmp > 65535U) { |
| 14422 | tmp = 65535U; |
| 14423 | } |
| 14424 | |
| 14425 | L4_MABX_B.DataType_ld = (uint16_T)tmp; |
| 14426 | |
| 14427 | /* End of DataTypeConversion: '<S986>/DataType' */ |
| 14428 | |
| 14429 | /* ArithShift: '<S976>/Shift_Arithmetic 3' */ |
| 14430 | L4_MABX_B.Shift_Arithmetic3_d = (uint16_T)((uint32_T)L4_MABX_B.DataType_ld >> |
| 14431 | 8); |
| 14432 | |
| 14433 | /* DataTypeConversion: '<S976>/Data Type Conversion8' */ |
| 14434 | tmp_0 = L4_MABX_B.Shift_Arithmetic3_d; |
| 14435 | if (tmp_0 > 255) { |
| 14436 | tmp_0 = 255U; |
| 14437 | } |
| 14438 | |
| 14439 | L4_MABX_B.DataTypeConversion8_p = (uint8_T)tmp_0; |
| 14440 | |
| 14441 | /* End of DataTypeConversion: '<S976>/Data Type Conversion8' */ |
| 14442 | |
| 14443 | /* S-Function (sfix_bitop): '<S987>/Operator' */ |
| 14444 | L4_MABX_B.Operator_hm = L4_MABX_B.DataTypeConversion3_hj & |
| 14445 | L4_MABX_P.Operator_BitMask_h2; |
| 14446 | |
| 14447 | /* DataTypeConversion: '<S987>/DataType' */ |
| 14448 | L4_MABX_B.DataType_jqm = L4_MABX_B.Operator_hm; |
| 14449 | |
| 14450 | /* ArithShift: '<S976>/Shift_Arithmetic 4' */ |
| 14451 | L4_MABX_B.Shift_Arithmetic4_ip = L4_MABX_B.DataType_jqm >> 16; |
| 14452 | |
| 14453 | /* DataTypeConversion: '<S976>/Data Type Conversion9' */ |
| 14454 | tmp = L4_MABX_B.Shift_Arithmetic4_ip; |
| 14455 | if (tmp > 255U) { |
| 14456 | tmp = 255U; |
| 14457 | } |
| 14458 | |
| 14459 | L4_MABX_B.DataTypeConversion9_a = (uint8_T)tmp; |
| 14460 | |
| 14461 | /* End of DataTypeConversion: '<S976>/Data Type Conversion9' */ |
| 14462 | |
| 14463 | /* S-Function (sfix_bitop): '<S988>/Operator' */ |
| 14464 | L4_MABX_B.Operator_n = L4_MABX_B.DataTypeConversion3_hj & |
| 14465 | L4_MABX_P.Operator_BitMask_oq; |
| 14466 | |
| 14467 | /* DataTypeConversion: '<S988>/DataType' */ |
| 14468 | L4_MABX_B.DataType_pd = L4_MABX_B.Operator_n; |
| 14469 | |
| 14470 | /* ArithShift: '<S976>/Shift_Arithmetic 5' */ |
| 14471 | L4_MABX_B.Shift_Arithmetic5_b = L4_MABX_B.DataType_pd >> 24; |
| 14472 | |
| 14473 | /* DataTypeConversion: '<S976>/Data Type Conversion10' */ |
| 14474 | tmp = L4_MABX_B.Shift_Arithmetic5_b; |
| 14475 | if (tmp > 255U) { |
| 14476 | tmp = 255U; |
| 14477 | } |
| 14478 | |
| 14479 | L4_MABX_B.DataTypeConversion10_g = (uint8_T)tmp; |
| 14480 | |
| 14481 | /* End of DataTypeConversion: '<S976>/Data Type Conversion10' */ |
| 14482 | |
| 14483 | /* Sum: '<S976>/Add' incorporates: |
| 14484 | * Constant: '<S976>/Constant' |
| 14485 | * Constant: '<S976>/Constant1' |
| 14486 | */ |
| 14487 | L4_MABX_B.Add_i = (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T) |
| 14488 | (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T) |
| 14489 | ((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T) |
| 14490 | (uint8_T)((uint32_T)L4_MABX_B.DataTypeConversion_pa + L4_MABX_B.DataType_pi) |
| 14491 | + L4_MABX_B.DataTypeConversion4_pt) + L4_MABX_B.DataTypeConversion5_k1) + |
| 14492 | L4_MABX_B.DataTypeConversion6_ml2) + L4_MABX_P.Constant_Value_ay) + |
| 14493 | L4_MABX_P.Constant1_Value_d) + L4_MABX_B.DataType_iy) + |
| 14494 | L4_MABX_B.DataTypeConversion8_p) + L4_MABX_B.DataTypeConversion9_a) |
| 14495 | + L4_MABX_B.DataTypeConversion10_g) + L4_MABX_B.DataType_bv); |
| 14496 | |
| 14497 | /* ArithShift: '<S976>/Shift_Arithmetic 6' */ |
| 14498 | L4_MABX_B.Shift_Arithmetic6_d = (uint8_T)((uint32_T)L4_MABX_B.Add_i >> 4); |
| 14499 | |
| 14500 | /* Sum: '<S976>/Add1' */ |
| 14501 | L4_MABX_B.Add1_e = (uint8_T)((uint32_T)L4_MABX_B.Shift_Arithmetic6_d + |
| 14502 | L4_MABX_B.Add_i); |
| 14503 | |
| 14504 | /* S-Function (sfix_bitop): '<S990>/Operator' */ |
| 14505 | L4_MABX_B.Operator_md = (uint8_T)(L4_MABX_B.Add1_e & |
| 14506 | L4_MABX_P.Operator_BitMask_dz); |
| 14507 | |
| 14508 | /* DataTypeConversion: '<S990>/DataType' */ |
| 14509 | L4_MABX_B.DataType_l1 = L4_MABX_B.Operator_md; |
| 14510 | |
| 14511 | /* ArithShift: '<S976>/Shift_Arithmetic 7' */ |
| 14512 | L4_MABX_B.Shift_Arithmetic7_p = (uint8_T)(L4_MABX_B.DataType_l1 << 4); |
| 14513 | |
| 14514 | /* S-Function (sfix_bitop): '<S991>/Operator' */ |
| 14515 | L4_MABX_B.Operator_m4 = (uint8_T)(L4_MABX_B.DataType_bv | |
| 14516 | L4_MABX_B.Shift_Arithmetic7_p); |
| 14517 | |
| 14518 | /* DataTypeConversion: '<S991>/DataType' */ |
| 14519 | L4_MABX_B.DataType_pw = L4_MABX_B.Operator_m4; |
| 14520 | |
| 14521 | /* DataTypeConversion: '<S942>/Data Type Conversion1' incorporates: |
| 14522 | * Constant: '<S976>/Constant' |
| 14523 | * Constant: '<S976>/Constant1' |
| 14524 | */ |
| 14525 | L4_MABX_B.DataTypeConversion1_g[0] = L4_MABX_B.DataTypeConversion_pa; |
| 14526 | L4_MABX_B.DataTypeConversion1_g[1] = L4_MABX_B.DataType_pi; |
| 14527 | L4_MABX_B.DataTypeConversion1_g[2] = L4_MABX_B.DataTypeConversion4_pt; |
| 14528 | L4_MABX_B.DataTypeConversion1_g[3] = L4_MABX_B.DataTypeConversion5_k1; |
| 14529 | L4_MABX_B.DataTypeConversion1_g[4] = L4_MABX_B.DataTypeConversion6_ml2; |
| 14530 | L4_MABX_B.DataTypeConversion1_g[5] = L4_MABX_P.Constant_Value_ay; |
| 14531 | L4_MABX_B.DataTypeConversion1_g[6] = L4_MABX_P.Constant1_Value_d; |
| 14532 | L4_MABX_B.DataTypeConversion1_g[7] = L4_MABX_B.DataType_pw; |
| 14533 | |
| 14534 | /* Outputs for Enabled SubSystem: '<S963>/PropB_REAX_1_E4' incorporates: |
| 14535 | * EnablePort: '<S965>/Enable' |
| 14536 | */ |
| 14537 | if (L4_MABX_B.Operator_bx) { |
| 14538 | /* S-Function (rti_commonblock): '<S965>/S-Function1' incorporates: |
| 14539 | * Constant: '<S963>/Constant' |
| 14540 | * Constant: '<S963>/Constant1' |
| 14541 | */ |
| 14542 | /* This comment workarounds a code generation problem */ |
| 14543 | |
| 14544 | /* dSPACE RTICAN TX Message Block: "PropB_REAX_1_E4" Id:419426276 */ |
| 14545 | { |
| 14546 | static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 14547 | 0x00 }; |
| 14548 | |
| 14549 | Float32 delayTime = 0.0; |
| 14550 | |
| 14551 | /* link this pointer to CAN_Msg for use in initialize_io_units() */ |
| 14552 | CANTP1_PTR_M1_C2_XTD_0x18FFEFE4 = &(CAN_Msg[0]); |
| 14553 | |
| 14554 | /* ... perform loop-back if required */ |
| 14555 | if (L4_MABX_P.Constant1_Value_il > 0.5) { |
| 14556 | /* ... updating the used tx-clientbuffer */ |
| 14557 | can_tp1_msg_update_all( CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->module, |
| 14558 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->queue ); |
| 14559 | |
| 14560 | /* ... Read status and timestamp info perform loop-back (previous message) */ |
| 14561 | can_tp1_tx_msg_read_loopback(CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4, |
| 14562 | 8, // datalen |
| 14563 | &(CAN_Msg[0]), |
| 14564 | CANTP1_RX_SPMSG_M1_C2_XTD); |
| 14565 | |
| 14566 | /* Convert timestamp */ |
| 14567 | if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->processed) { |
| 14568 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp = |
| 14569 | rtk_dsts_time_to_simtime_convert |
| 14570 | (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp); |
| 14571 | } |
| 14572 | } else { |
| 14573 | /* ... Read status and timestamp info (previous message) */ |
| 14574 | can_tp1_msg_read_from_dsmcr(CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4); |
| 14575 | |
| 14576 | /* Convert timestamp */ |
| 14577 | if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->processed) { |
| 14578 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp = |
| 14579 | rtk_dsts_time_to_simtime_convert |
| 14580 | (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp); |
| 14581 | } |
| 14582 | } |
| 14583 | |
| 14584 | /* Messages with timestamp zero have been received in pause/stop state |
| 14585 | and must not be handled. |
| 14586 | */ |
| 14587 | if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp > 0.0) { |
| 14588 | L4_MABX_B.SFunction1_o1_mb = (real_T) |
| 14589 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->processed; |
| 14590 | L4_MABX_B.SFunction1_o2_a = (real_T) |
| 14591 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp; |
| 14592 | L4_MABX_B.SFunction1_o3_kc = (real_T) |
| 14593 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->deltatime; |
| 14594 | L4_MABX_B.SFunction1_o4_c = (real_T) |
| 14595 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->delaytime; |
| 14596 | } |
| 14597 | |
| 14598 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 14599 | { |
| 14600 | rtican_Signal_t CAN_Sgn; |
| 14601 | UInt32 i; |
| 14602 | |
| 14603 | /* Initialize the static message data to zero */ |
| 14604 | for (i=0; i<8; i++ ) |
| 14605 | CAN_Msg[i] = 0; |
| 14606 | |
| 14607 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 14608 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14609 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_g[0] ) + |
| 14610 | 0.5); |
| 14611 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14612 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 14613 | |
| 14614 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 14615 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14616 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_g[1] ) + |
| 14617 | 0.5); |
| 14618 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14619 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 14620 | |
| 14621 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 14622 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14623 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_g[2] ) + |
| 14624 | 0.5); |
| 14625 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14626 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 14627 | |
| 14628 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 14629 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14630 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_g[3] ) + |
| 14631 | 0.5); |
| 14632 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14633 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 14634 | |
| 14635 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 14636 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14637 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_g[4] ) + |
| 14638 | 0.5); |
| 14639 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14640 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 14641 | |
| 14642 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 14643 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14644 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_g[5] ) + |
| 14645 | 0.5); |
| 14646 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14647 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 14648 | |
| 14649 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 14650 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14651 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_g[6] ) + |
| 14652 | 0.5); |
| 14653 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14654 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 14655 | |
| 14656 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 14657 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14658 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_g[7] ) + |
| 14659 | 0.5); |
| 14660 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14661 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 14662 | } |
| 14663 | |
| 14664 | delayTime = (Float32) L4_MABX_P.Constant_Value_p1 / (1700); |
| 14665 | |
| 14666 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 14667 | can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FFEFE4], 8, |
| 14668 | &(CAN_Msg[0]), delayTime); |
| 14669 | } |
| 14670 | } |
| 14671 | |
| 14672 | /* End of Outputs for SubSystem: '<S963>/PropB_REAX_1_E4' */ |
| 14673 | |
| 14674 | /* Outputs for Enabled SubSystem: '<S964>/PropB_REAX_1_E4' incorporates: |
| 14675 | * EnablePort: '<S966>/Enable' |
| 14676 | */ |
| 14677 | if (L4_MABX_B.EnablePropB_ReAX_CAN6) { |
| 14678 | /* S-Function (rti_commonblock): '<S966>/S-Function1' incorporates: |
| 14679 | * Constant: '<S964>/Constant' |
| 14680 | * Constant: '<S964>/Constant1' |
| 14681 | */ |
| 14682 | /* This comment workarounds a code generation problem */ |
| 14683 | |
| 14684 | /* dSPACE RTICAN TX Message Block: "PropB_REAX_1_E4" Id:419426276 */ |
| 14685 | { |
| 14686 | static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 14687 | 0x00 }; |
| 14688 | |
| 14689 | Float32 delayTime = 0.0; |
| 14690 | |
| 14691 | /* link this pointer to CAN_Msg for use in initialize_io_units() */ |
| 14692 | CANTP1_PTR_M3_C2_XTD_0x18FFEFE4 = &(CAN_Msg[0]); |
| 14693 | |
| 14694 | /* ... perform loop-back if required */ |
| 14695 | if (L4_MABX_P.Constant1_Value_np > 0.5) { |
| 14696 | /* ... updating the used tx-clientbuffer */ |
| 14697 | can_tp1_msg_update_all( CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->module, |
| 14698 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->queue ); |
| 14699 | |
| 14700 | /* ... Read status and timestamp info perform loop-back (previous message) */ |
| 14701 | can_tp1_tx_msg_read_loopback(CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4, |
| 14702 | 8, // datalen |
| 14703 | &(CAN_Msg[0]), |
| 14704 | CANTP1_RX_SPMSG_M3_C2_XTD); |
| 14705 | |
| 14706 | /* Convert timestamp */ |
| 14707 | if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->processed) { |
| 14708 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp = |
| 14709 | rtk_dsts_time_to_simtime_convert |
| 14710 | (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp); |
| 14711 | } |
| 14712 | } else { |
| 14713 | /* ... Read status and timestamp info (previous message) */ |
| 14714 | can_tp1_msg_read_from_dsmcr(CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4); |
| 14715 | |
| 14716 | /* Convert timestamp */ |
| 14717 | if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->processed) { |
| 14718 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp = |
| 14719 | rtk_dsts_time_to_simtime_convert |
| 14720 | (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp); |
| 14721 | } |
| 14722 | } |
| 14723 | |
| 14724 | /* Messages with timestamp zero have been received in pause/stop state |
| 14725 | and must not be handled. |
| 14726 | */ |
| 14727 | if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp > 0.0) { |
| 14728 | L4_MABX_B.SFunction1_o1_b0 = (real_T) |
| 14729 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->processed; |
| 14730 | L4_MABX_B.SFunction1_o2_ks = (real_T) |
| 14731 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp; |
| 14732 | L4_MABX_B.SFunction1_o3_p = (real_T) |
| 14733 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->deltatime; |
| 14734 | L4_MABX_B.SFunction1_o4_fu = (real_T) |
| 14735 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->delaytime; |
| 14736 | } |
| 14737 | |
| 14738 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 14739 | { |
| 14740 | rtican_Signal_t CAN_Sgn; |
| 14741 | UInt32 i; |
| 14742 | |
| 14743 | /* Initialize the static message data to zero */ |
| 14744 | for (i=0; i<8; i++ ) |
| 14745 | CAN_Msg[i] = 0; |
| 14746 | |
| 14747 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 14748 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14749 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_g[0] ) + |
| 14750 | 0.5); |
| 14751 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14752 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 14753 | |
| 14754 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 14755 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14756 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_g[1] ) + |
| 14757 | 0.5); |
| 14758 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14759 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 14760 | |
| 14761 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 14762 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14763 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_g[2] ) + |
| 14764 | 0.5); |
| 14765 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14766 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 14767 | |
| 14768 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 14769 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14770 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_g[3] ) + |
| 14771 | 0.5); |
| 14772 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14773 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 14774 | |
| 14775 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 14776 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14777 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_g[4] ) + |
| 14778 | 0.5); |
| 14779 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14780 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 14781 | |
| 14782 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 14783 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14784 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_g[5] ) + |
| 14785 | 0.5); |
| 14786 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14787 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 14788 | |
| 14789 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 14790 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14791 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_g[6] ) + |
| 14792 | 0.5); |
| 14793 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14794 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 14795 | |
| 14796 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 14797 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14798 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_g[7] ) + |
| 14799 | 0.5); |
| 14800 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14801 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 14802 | } |
| 14803 | |
| 14804 | delayTime = (Float32) L4_MABX_P.Constant_Value_jo / (1700); |
| 14805 | |
| 14806 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 14807 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0X18FFEFE4], 8, |
| 14808 | &(CAN_Msg[0]), delayTime); |
| 14809 | } |
| 14810 | } |
| 14811 | |
| 14812 | /* End of Outputs for SubSystem: '<S964>/PropB_REAX_1_E4' */ |
| 14813 | |
| 14814 | /* DataTypeConversion: '<S943>/Data Type Conversion' incorporates: |
| 14815 | * Constant: '<S854>/CANT_VDC2_0B_CHANNEL_APV' |
| 14816 | */ |
| 14817 | L4_MABX_B.DataTypeConversion_nc = (uint8_T) |
| 14818 | L4_MABX_P.CANT_VDC2_0B_CHANNEL_APV_Value; |
| 14819 | |
| 14820 | /* S-Function (sfix_bitop): '<S971>/Operator' */ |
| 14821 | L4_MABX_B.Operator_pjf = (uint8_T)(L4_MABX_B.DataTypeConversion_nc & |
| 14822 | L4_MABX_P.Operator_BitMask_kl); |
| 14823 | |
| 14824 | /* DataTypeConversion: '<S971>/DataType' */ |
| 14825 | L4_MABX_B.DataType_lx = L4_MABX_B.Operator_pjf; |
| 14826 | |
| 14827 | /* ArithShift: '<S943>/Shift_Arithmetic 3' */ |
| 14828 | L4_MABX_B.Shift_Arithmetic3_h = ldexp(L4_MABX_B.DataType_lx, (-4)); |
| 14829 | |
| 14830 | /* DataTypeConversion: '<S943>/Data Type Conversion6' */ |
| 14831 | L4_MABX_B.DataTypeConversion6_b = (L4_MABX_B.Shift_Arithmetic3_h != 0.0); |
| 14832 | |
| 14833 | /* Outputs for Enabled SubSystem: '<S973>/VDC2_0B' incorporates: |
| 14834 | * EnablePort: '<S974>/Enable' |
| 14835 | */ |
| 14836 | if (L4_MABX_B.DataTypeConversion6_b) { |
| 14837 | /* S-Function (rti_commonblock): '<S974>/S-Function1' */ |
| 14838 | /* This comment workarounds a code generation problem */ |
| 14839 | |
| 14840 | /* dSPACE RTICAN TX Message Block: "VDC2_0B" Id:418384139 */ |
| 14841 | { |
| 14842 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 14843 | |
| 14844 | Float32 delayTime = 0.0; |
| 14845 | |
| 14846 | /* ... Read status and timestamp info (previous message) */ |
| 14847 | can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]); |
| 14848 | |
| 14849 | /* Convert timestamp */ |
| 14850 | if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->processed) { |
| 14851 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->timestamp = |
| 14852 | rtk_dsts_time_to_simtime_convert |
| 14853 | (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->timestamp); |
| 14854 | } |
| 14855 | |
| 14856 | /* Messages with timestamp zero have been received in pause/stop state |
| 14857 | and must not be handled. |
| 14858 | */ |
| 14859 | if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->timestamp > 0.0) { |
| 14860 | L4_MABX_B.SFunction1_o1_mc = (real_T) |
| 14861 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->processed; |
| 14862 | L4_MABX_B.SFunction1_o2_nj = (real_T) |
| 14863 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->timestamp; |
| 14864 | L4_MABX_B.SFunction1_o3_mw = (real_T) |
| 14865 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->deltatime; |
| 14866 | L4_MABX_B.SFunction1_o4_l = (real_T) |
| 14867 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->delaytime; |
| 14868 | } |
| 14869 | |
| 14870 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 14871 | { |
| 14872 | rtican_Signal_t CAN_Sgn; |
| 14873 | |
| 14874 | /* ...... "SteerWheelAngle" (0|16, standard signal, unsigned int, little endian) */ |
| 14875 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14876 | CAN_Sgn.UnsignedSgn = (UInt32) (( SteerWheelAngle - ( -31.374 ) ) / |
| 14877 | 0.0009765625 + 0.5); |
| 14878 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 14879 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 14880 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte1; |
| 14881 | |
| 14882 | /* ...... "SteerWheelTurnCounter" (16|6, standard signal, unsigned int, little endian) */ |
| 14883 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14884 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.SFunction1_o2_gl - ( -32 ) + |
| 14885 | 0.5); |
| 14886 | CAN_Sgn.UnsignedSgn &= 0x0000003F; |
| 14887 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 14888 | |
| 14889 | /* ...... "SteerWheelAngleSensorType" (22|2, standard signal, unsigned int, little endian) */ |
| 14890 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14891 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o3_gw ) + 0.5); |
| 14892 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 14893 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 14894 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 14895 | |
| 14896 | /* ...... "YawRate" (24|16, standard signal, unsigned int, little endian) */ |
| 14897 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14898 | CAN_Sgn.UnsignedSgn = (UInt32) (( YawRate - ( -3.92 ) ) / |
| 14899 | 0.0001220703125 + 0.5); |
| 14900 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 14901 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 14902 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte1; |
| 14903 | |
| 14904 | /* ...... "LateralAcceleration" (40|16, standard signal, unsigned int, little endian) */ |
| 14905 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14906 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o5_d - ( -15.687 ) |
| 14907 | ) / 0.00048828125 + 0.5); |
| 14908 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 14909 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 14910 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte1; |
| 14911 | |
| 14912 | /* ...... "LongitudinalAcceleration" (56|8, standard signal, unsigned int, little endian) */ |
| 14913 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 14914 | CAN_Sgn.UnsignedSgn = (UInt32) (( SPN1810_LongitudinalAcceleration - |
| 14915 | ( -12.5 ) ) / 0.1 + 0.5); |
| 14916 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 14917 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 14918 | } |
| 14919 | |
| 14920 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 14921 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B], 8, |
| 14922 | &(CAN_Msg[0]), delayTime); |
| 14923 | } |
| 14924 | } |
| 14925 | |
| 14926 | /* End of Outputs for SubSystem: '<S973>/VDC2_0B' */ |
| 14927 | |
| 14928 | /* S-Function (sfix_bitop): '<S967>/Operator' */ |
| 14929 | L4_MABX_B.Operator_hp = (uint8_T)(L4_MABX_B.DataTypeConversion_nc & |
| 14930 | L4_MABX_P.Operator_BitMask_hh); |
| 14931 | |
| 14932 | /* DataTypeConversion: '<S967>/DataType' */ |
| 14933 | L4_MABX_B.DataType_at = L4_MABX_B.Operator_hp; |
| 14934 | |
| 14935 | /* S-Function (sfix_bitop): '<S968>/Operator' */ |
| 14936 | L4_MABX_B.Operator_fp = (uint8_T)(L4_MABX_B.DataTypeConversion_nc & |
| 14937 | L4_MABX_P.Operator_BitMask_p); |
| 14938 | |
| 14939 | /* DataTypeConversion: '<S968>/DataType' */ |
| 14940 | L4_MABX_B.DataType_a = L4_MABX_B.Operator_fp; |
| 14941 | |
| 14942 | /* S-Function (sfix_bitop): '<S969>/Operator' */ |
| 14943 | L4_MABX_B.Operator_l4 = (uint8_T)(L4_MABX_B.DataTypeConversion_nc & |
| 14944 | L4_MABX_P.Operator_BitMask_cb); |
| 14945 | |
| 14946 | /* DataTypeConversion: '<S969>/DataType' */ |
| 14947 | L4_MABX_B.DataType_gc = L4_MABX_B.Operator_l4; |
| 14948 | |
| 14949 | /* S-Function (sfix_bitop): '<S970>/Operator' */ |
| 14950 | L4_MABX_B.Operator_cs = (uint8_T)(L4_MABX_B.DataTypeConversion_nc & |
| 14951 | L4_MABX_P.Operator_BitMask_ip); |
| 14952 | |
| 14953 | /* DataTypeConversion: '<S970>/DataType' */ |
| 14954 | L4_MABX_B.DataType_gv = L4_MABX_B.Operator_cs; |
| 14955 | |
| 14956 | /* S-Function (sfix_bitop): '<S972>/Operator' */ |
| 14957 | L4_MABX_B.Operator_g1 = (uint8_T)(L4_MABX_B.DataTypeConversion_nc & |
| 14958 | L4_MABX_P.Operator_BitMask_nq); |
| 14959 | |
| 14960 | /* DataTypeConversion: '<S972>/DataType' */ |
| 14961 | L4_MABX_B.DataType_j = L4_MABX_B.Operator_g1; |
| 14962 | |
| 14963 | /* DataTypeConversion: '<S943>/Data Type Conversion1' */ |
| 14964 | L4_MABX_B.DataTypeConversion1_kb = (L4_MABX_B.DataType_at != 0); |
| 14965 | |
| 14966 | /* ArithShift: '<S943>/Shift_Arithmetic ' */ |
| 14967 | L4_MABX_B.Shift_Arithmetic_m = ldexp(L4_MABX_B.DataType_a, (-1)); |
| 14968 | |
| 14969 | /* DataTypeConversion: '<S943>/Data Type Conversion3' */ |
| 14970 | L4_MABX_B.DataTypeConversion3_c2 = (L4_MABX_B.Shift_Arithmetic_m != 0.0); |
| 14971 | |
| 14972 | /* ArithShift: '<S943>/Shift_Arithmetic 1' */ |
| 14973 | L4_MABX_B.Shift_Arithmetic1_i = ldexp(L4_MABX_B.DataType_gc, (-2)); |
| 14974 | |
| 14975 | /* DataTypeConversion: '<S943>/Data Type Conversion4' */ |
| 14976 | L4_MABX_B.DataTypeConversion4_am = (L4_MABX_B.Shift_Arithmetic1_i != 0.0); |
| 14977 | |
| 14978 | /* ArithShift: '<S943>/Shift_Arithmetic 2' */ |
| 14979 | L4_MABX_B.Shift_Arithmetic2_hc = ldexp(L4_MABX_B.DataType_gv, (-3)); |
| 14980 | |
| 14981 | /* DataTypeConversion: '<S943>/Data Type Conversion5' */ |
| 14982 | L4_MABX_B.DataTypeConversion5_f4 = (L4_MABX_B.Shift_Arithmetic2_hc != 0.0); |
| 14983 | |
| 14984 | /* ArithShift: '<S943>/Shift_Arithmetic 4' */ |
| 14985 | L4_MABX_B.Shift_Arithmetic4_o = ldexp(L4_MABX_B.DataType_j, (-5)); |
| 14986 | |
| 14987 | /* DataTypeConversion: '<S943>/Data Type Conversion7' */ |
| 14988 | L4_MABX_B.DataTypeConversion7_dr = (L4_MABX_B.Shift_Arithmetic4_o != 0.0); |
| 14989 | |
| 14990 | /* Logic: '<S1004>/Logical Operator1' */ |
| 14991 | L4_MABX_B.LogicalOperator1_pm = !L4_MABX_B.Operator_MX; |
| 14992 | |
| 14993 | /* Logic: '<S1004>/Logical Operator' */ |
| 14994 | L4_MABX_B.LogicalOperator_pq = (L4_MABX_B.LogicalOperator1_pm && |
| 14995 | L4_MABX_B.Operator_MN); |
| 14996 | |
| 14997 | /* RelationalOperator: '<S1008>/Operator' */ |
| 14998 | L4_MABX_B.Operator_iv = (L4_MABX_B.Switch1_b == L4_MABX_B.Width_l); |
| 14999 | |
| 15000 | /* End of Outputs for SubSystem: '<S849>/CAN_TX_10ms' */ |
| 15001 | |
| 15002 | /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_20ms' */ |
| 15003 | |
| 15004 | /* RateTransition: '<S1015>/TmpRTBAtDivide1Inport1' */ |
| 15005 | if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) { |
| 15006 | L4_MABX_B.BrakingPID_Y_g = L4_MABX_B.BrakingPID_Y_k; |
| 15007 | L4_MABX_B.AutonomousOutputEnabled_n1 = AutonomousOutputEnabled; |
| 15008 | L4_MABX_B.BrakingControlActive_d = L4_MABX_B.F_Brake_control_active; |
| 15009 | L4_MABX_B.TmpRTBAtLogicalOperator8Inport1 = AutonomousOutputEnabled; |
| 15010 | L4_MABX_B.TmpRTBAtLogicalOperator1Inport2 = AutonomousOutputEnabled; |
| 15011 | L4_MABX_B.TmpRTBAtUnit_DelayInport1 = AutonomousOutputEnabled; |
| 15012 | L4_MABX_B.BrakingPID_Y_gr = L4_MABX_B.BrakingPID_Y_k; |
| 15013 | L4_MABX_B.FrontAxleSpeed_g = L4_MABX_B.SFunction1_o1_ee; |
| 15014 | L4_MABX_B.SPN1807_SteeringWheelAngle_j = SteerWheelAngle; |
| 15015 | L4_MABX_B.SPN1808_YawRate_o = YawRate; |
| 15016 | L4_MABX_B.SPN1810_LongitudinalAccelerat_i = SPN1810_LongitudinalAcceleration; |
| 15017 | } |
| 15018 | |
| 15019 | /* End of Outputs for SubSystem: '<S849>/CAN_TX_20ms' */ |
| 15020 | |
| 15021 | /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_5000ms' */ |
| 15022 | |
| 15023 | /* RateTransition: '<S1044>/TmpRTBAtOperatorInport2' */ |
| 15024 | if (L4_MABX_M->Timing.RateInteraction.TID0_7 == 1) { |
| 15025 | L4_MABX_B.TmpRTBAtOperatorInport2 = AutonomousOutputEnabled; |
| 15026 | } |
| 15027 | |
| 15028 | /* End of RateTransition: '<S1044>/TmpRTBAtOperatorInport2' */ |
| 15029 | |
| 15030 | /* End of Outputs for SubSystem: '<S849>/CAN_TX_5000ms' */ |
| 15031 | |
| 15032 | /* Outputs for Enabled SubSystem: '<S640>/TC1_03_05' incorporates: |
| 15033 | * EnablePort: '<S641>/Enable' |
| 15034 | */ |
| 15035 | /* Constant: '<S455>/Constant' */ |
| 15036 | if (L4_MABX_P.Constant_Value_bx) { |
| 15037 | /* S-Function (rti_commonblock): '<S641>/S-Function1' */ |
| 15038 | /* This comment workarounds a code generation problem */ |
| 15039 | |
| 15040 | /* dSPACE RTICAN RX Message Block: "TC1_03_05" Id:201392901 */ |
| 15041 | { |
| 15042 | UInt32 *CAN_Msg; |
| 15043 | static dsfloat time_old = 0.0; |
| 15044 | |
| 15045 | /* Read status and timestamp info (previous message) */ |
| 15046 | if (can_type1_M3_C1_XTD[CANTP1_M3_C1_RXSRVC_XTD_0xC010305].timestamp != |
| 15047 | time_old) { |
| 15048 | /* ... save timestamp info for the calculation of the RX status |
| 15049 | during the consecutive sample hit*/ |
| 15050 | time_old = can_type1_M3_C1_XTD[CANTP1_M3_C1_RXSRVC_XTD_0xC010305]. |
| 15051 | timestamp; |
| 15052 | |
| 15053 | /* ... set the processed flag to one */ |
| 15054 | L4_MABX_B.SFunction1_o26 = 1.0; |
| 15055 | L4_MABX_B.SFunction1_o27 = (real_T) |
| 15056 | can_type1_M3_C1_XTD[CANTP1_M3_C1_RXSRVC_XTD_0xC010305].timestamp; |
| 15057 | L4_MABX_B.SFunction1_o28 = (real_T) |
| 15058 | can_type1_M3_C1_XTD[CANTP1_M3_C1_RXSRVC_XTD_0xC010305].deltatime; |
| 15059 | CAN_Msg = can_type1_M3_C1_XTD[CANTP1_M3_C1_RXSRVC_XTD_0xC010305].data; |
| 15060 | |
| 15061 | /* Decode CAN message */ |
| 15062 | { |
| 15063 | { |
| 15064 | rtican_Signal_t CAN_Sgn; |
| 15065 | |
| 15066 | /* ...... "SPN681_TransGearShiftInhibitReq" (0|2, standard signal, unsigned int, little endian) */ |
| 15067 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 15068 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15069 | L4_MABX_B.SFunction1_o1_c = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15070 | |
| 15071 | /* ...... "SPN682_TransTrqConvLockupDisReq" (2|2, standard signal, unsigned int, little endian) */ |
| 15072 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 15073 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 15074 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15075 | L4_MABX_B.SFunction1_o2_e = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15076 | |
| 15077 | /* ...... "SPN683_DisengageDrivelineReq" (4|2, standard signal, unsigned int, little endian) */ |
| 15078 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 15079 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 15080 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15081 | L4_MABX_B.SFunction1_o3_bi = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15082 | |
| 15083 | /* ...... "SPN4242_TransRevGearShiftInhibRq" (6|2, standard signal, unsigned int, little endian) */ |
| 15084 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 15085 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 15086 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15087 | L4_MABX_B.SFunction1_o4_lf = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15088 | |
| 15089 | /* ...... "SPN684_RequestedPercClutchSlip" (8|8, standard signal, unsigned int, little endian) */ |
| 15090 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 15091 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15092 | L4_MABX_B.SFunction1_o5_p = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 15093 | |
| 15094 | /* ...... "SPN525_TransRequestedGear" (16|8, standard signal, unsigned int, little endian) */ |
| 15095 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 15096 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15097 | L4_MABX_B.SFunction1_o6_i = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 15098 | |
| 15099 | /* ...... "SPN685_DisengageDiffLockRqFrAx1" (24|2, standard signal, unsigned int, little endian) */ |
| 15100 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 15101 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15102 | L4_MABX_B.SFunction1_o7_d = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15103 | |
| 15104 | /* ...... "SPN686_DisengageDiffLockRqFrAx2" (26|2, standard signal, unsigned int, little endian) */ |
| 15105 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 15106 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 15107 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15108 | L4_MABX_B.SFunction1_o8_a = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15109 | |
| 15110 | /* ...... "SPN687_DisengageDiffLockRqRrAx1" (28|2, standard signal, unsigned int, little endian) */ |
| 15111 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 15112 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 15113 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15114 | L4_MABX_B.SFunction1_o9_i = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15115 | |
| 15116 | /* ...... "SPN688_DisengageDiffLockRqRrAx2" (30|2, standard signal, unsigned int, little endian) */ |
| 15117 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 15118 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 15119 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15120 | L4_MABX_B.SFunction1_o10_o = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15121 | |
| 15122 | /* ...... "SPN689_DisengageDiffLockRqC" (32|2, standard signal, unsigned int, little endian) */ |
| 15123 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 15124 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15125 | L4_MABX_B.SFunction1_o11 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15126 | |
| 15127 | /* ...... "SPN690_DisengageDiffLockRqCF" (34|2, standard signal, unsigned int, little endian) */ |
| 15128 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 15129 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 15130 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15131 | L4_MABX_B.SFunction1_o12 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15132 | |
| 15133 | /* ...... "SPN691_DisengageDiffLockRqCR" (36|2, standard signal, unsigned int, little endian) */ |
| 15134 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 15135 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 15136 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15137 | L4_MABX_B.SFunction1_o13 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15138 | |
| 15139 | /* ...... "SPN5762_TransLoadRedInhibitRq" (38|2, standard signal, unsigned int, little endian) */ |
| 15140 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 15141 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 15142 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15143 | L4_MABX_B.SFunction1_o14 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15144 | |
| 15145 | /* ...... "SPN1852_TransmissionMode1" (40|2, standard signal, unsigned int, little endian) */ |
| 15146 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 15147 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15148 | L4_MABX_B.SFunction1_o15 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15149 | |
| 15150 | /* ...... "SPN1853_TransmissionMode2" (42|2, standard signal, unsigned int, little endian) */ |
| 15151 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 15152 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 15153 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15154 | L4_MABX_B.SFunction1_o16 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15155 | |
| 15156 | /* ...... "SPN1854_TransmissionMode3" (44|2, standard signal, unsigned int, little endian) */ |
| 15157 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 15158 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 15159 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15160 | L4_MABX_B.SFunction1_o17 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15161 | |
| 15162 | /* ...... "SPN1855_TransmissionMode4" (46|2, standard signal, unsigned int, little endian) */ |
| 15163 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 15164 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 15165 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15166 | L4_MABX_B.SFunction1_o18 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15167 | |
| 15168 | /* ...... "SPN7695_TransAutoNeutralRequest" (48|2, standard signal, unsigned int, little endian) */ |
| 15169 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 15170 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15171 | L4_MABX_B.SFunction1_o19 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15172 | |
| 15173 | /* ...... "SPN4255_TransRequestedLaunchGear" (50|4, standard signal, unsigned int, little endian) */ |
| 15174 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 15175 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 15176 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 15177 | L4_MABX_B.SFunction1_o20 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15178 | |
| 15179 | /* ...... "SPN2985_TransShiftSelDispModeSw" (54|2, standard signal, unsigned int, little endian) */ |
| 15180 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 15181 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 15182 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15183 | L4_MABX_B.SFunction1_o21 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15184 | |
| 15185 | /* ...... "SPN4246_TransmissionMode5" (56|2, standard signal, unsigned int, little endian) */ |
| 15186 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 15187 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15188 | L4_MABX_B.SFunction1_o22 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15189 | |
| 15190 | /* ...... "SPN4247_TransmissionMode6" (58|2, standard signal, unsigned int, little endian) */ |
| 15191 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 15192 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 15193 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15194 | L4_MABX_B.SFunction1_o23 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15195 | |
| 15196 | /* ...... "SPN4248_TransmissionMode7" (60|2, standard signal, unsigned int, little endian) */ |
| 15197 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 15198 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 15199 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15200 | L4_MABX_B.SFunction1_o24 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15201 | |
| 15202 | /* ...... "SPN4249_TransmissionMode8" (62|2, standard signal, unsigned int, little endian) */ |
| 15203 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 15204 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 15205 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 15206 | L4_MABX_B.SFunction1_o25 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15207 | } |
| 15208 | } |
| 15209 | } else { |
| 15210 | /* set RX status to 0 because no new message has arrived */ |
| 15211 | L4_MABX_B.SFunction1_o26 = 0.0; |
| 15212 | } |
| 15213 | } |
| 15214 | } |
| 15215 | |
| 15216 | /* End of Constant: '<S455>/Constant' */ |
| 15217 | /* End of Outputs for SubSystem: '<S640>/TC1_03_05' */ |
| 15218 | |
| 15219 | /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_50ms' */ |
| 15220 | |
| 15221 | /* RateTransition: '<S1054>/TmpRTBAtCCVS1_E3Inport1' */ |
| 15222 | if (L4_MABX_M->Timing.RateInteraction.TID0_2 == 1) { |
| 15223 | L4_MABX_B.TwoSpeedAxleSwitch = L4_MABX_B.SFunction1_o1_fd; |
| 15224 | L4_MABX_B.ParkingBrakeSwitch = L4_MABX_B.SFunction1_o2_ij; |
| 15225 | L4_MABX_B.CruiseCtrlPauseSwitch = L4_MABX_B.SFunction1_o3_l1; |
| 15226 | L4_MABX_B.ParkBrakeReleaseInhibitRq = L4_MABX_B.SFunction1_o4_fw; |
| 15227 | L4_MABX_B.WheelBasedVehicleSpeed_h = WheelBasedVehicleSpeed; |
| 15228 | L4_MABX_B.CruiseCtrlActive = L4_MABX_B.SFunction1_o6_jo; |
| 15229 | L4_MABX_B.CruiseCtrlEnableSwitch_n = L4_MABX_B.SFunction1_o7_ba; |
| 15230 | L4_MABX_B.BrakeSwitch_i = BrakeSwitch; |
| 15231 | L4_MABX_B.ClutchSwitch = L4_MABX_B.SFunction1_o9_ig; |
| 15232 | L4_MABX_B.CruiseCtrlSetSwitch = L4_MABX_B.SFunction1_o10_i; |
| 15233 | L4_MABX_B.CruiseCtrlCoastSwitch = L4_MABX_B.SFunction1_o11_j; |
| 15234 | L4_MABX_B.CruiseCtrlResumeSwitch = L4_MABX_B.SFunction1_o12_bc; |
| 15235 | L4_MABX_B.CruiseCtrlAccelerateSwitch = L4_MABX_B.SFunction1_o13_oz; |
| 15236 | L4_MABX_B.CruiseCtrlSetSpeed = L4_MABX_B.SFunction1_o14_en; |
| 15237 | L4_MABX_B.PTOGovernorState = L4_MABX_B.SFunction1_o15_i; |
| 15238 | L4_MABX_B.CruiseCtrlStates = L4_MABX_B.SFunction1_o16_fi; |
| 15239 | L4_MABX_B.EngIdleIncrementSwitch = L4_MABX_B.SFunction1_o17_e; |
| 15240 | L4_MABX_B.EngIdleDecrementSwitch = L4_MABX_B.SFunction1_o18_i; |
| 15241 | L4_MABX_B.EngTestModeSwitch = L4_MABX_B.SFunction1_o19_e; |
| 15242 | L4_MABX_B.EngShutdownOverrideSwitch = L4_MABX_B.SFunction1_o20_l; |
| 15243 | L4_MABX_B.SPN681_TransGearShiftInhibitReq = L4_MABX_B.SFunction1_o1_c; |
| 15244 | L4_MABX_B.SPN682_TransTrqConvLockupDisReq = L4_MABX_B.SFunction1_o2_e; |
| 15245 | L4_MABX_B.SPN683_DisengageDrivelineReq = L4_MABX_B.SFunction1_o3_bi; |
| 15246 | L4_MABX_B.SPN4242_TransRevGearShiftInhibR = L4_MABX_B.SFunction1_o4_lf; |
| 15247 | L4_MABX_B.SPN684_RequestedPercClutchSlip = L4_MABX_B.SFunction1_o5_p; |
| 15248 | L4_MABX_B.SPN525_TransRequestedGear = L4_MABX_B.SFunction1_o6_i; |
| 15249 | L4_MABX_B.SPN685_DisengageDiffLockRqFrAx1 = L4_MABX_B.SFunction1_o7_d; |
| 15250 | L4_MABX_B.SPN686_DisengageDiffLockRqFrAx2 = L4_MABX_B.SFunction1_o8_a; |
| 15251 | L4_MABX_B.SPN687_DisengageDiffLockRqRrAx1 = L4_MABX_B.SFunction1_o9_i; |
| 15252 | L4_MABX_B.SPN688_DisengageDiffLockRqRrAx2 = L4_MABX_B.SFunction1_o10_o; |
| 15253 | L4_MABX_B.SPN689_DisengageDiffLockRqC = L4_MABX_B.SFunction1_o11; |
| 15254 | L4_MABX_B.SPN690_DisengageDiffLockRqCF = L4_MABX_B.SFunction1_o12; |
| 15255 | L4_MABX_B.SPN691_DisengageDiffLockRqCR = L4_MABX_B.SFunction1_o13; |
| 15256 | L4_MABX_B.SPN5762_TransLoadRedInhibitRq = L4_MABX_B.SFunction1_o14; |
| 15257 | L4_MABX_B.SPN1852_TransmissionMode1 = L4_MABX_B.SFunction1_o15; |
| 15258 | L4_MABX_B.SPN1853_TransmissionMode2 = L4_MABX_B.SFunction1_o16; |
| 15259 | L4_MABX_B.SPN1854_TransmissionMode3 = L4_MABX_B.SFunction1_o17; |
| 15260 | L4_MABX_B.SPN1855_TransmissionMode4 = L4_MABX_B.SFunction1_o18; |
| 15261 | L4_MABX_B.SPN7695_TransAutoNeutralRequest = L4_MABX_B.SFunction1_o19; |
| 15262 | L4_MABX_B.SPN4255_TransRequestedLaunchGea = L4_MABX_B.SFunction1_o20; |
| 15263 | L4_MABX_B.SPN2985_TransShiftSelDispModeSw = L4_MABX_B.SFunction1_o21; |
| 15264 | L4_MABX_B.SPN4246_TransmissionMode5 = L4_MABX_B.SFunction1_o22; |
| 15265 | L4_MABX_B.SPN4247_TransmissionMode6 = L4_MABX_B.SFunction1_o23; |
| 15266 | L4_MABX_B.SPN4248_TransmissionMode7 = L4_MABX_B.SFunction1_o24; |
| 15267 | L4_MABX_B.SPN4249_TransmissionMode8 = L4_MABX_B.SFunction1_o25; |
| 15268 | } |
| 15269 | |
| 15270 | /* End of Outputs for SubSystem: '<S849>/CAN_TX_50ms' */ |
| 15271 | |
| 15272 | /* Outputs for Enabled SubSystem: '<S638>/SystemTime_01' incorporates: |
| 15273 | * EnablePort: '<S639>/Enable' |
| 15274 | */ |
| 15275 | /* Constant: '<S454>/Constant' */ |
| 15276 | if (L4_MABX_P.Constant_Value_m > 0.0) { |
| 15277 | /* S-Function (rti_commonblock): '<S639>/S-Function1' */ |
| 15278 | /* This comment workarounds a code generation problem */ |
| 15279 | |
| 15280 | /* dSPACE RTICAN RX Message Block: "SystemTime_01" Id:233836544 */ |
| 15281 | { |
| 15282 | UInt32 *CAN_Msg; |
| 15283 | static dsfloat time_old = 0.0; |
| 15284 | |
| 15285 | /* Read status and timestamp info (previous message) */ |
| 15286 | if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0xDF01000].timestamp != |
| 15287 | time_old) { |
| 15288 | /* ... save timestamp info for the calculation of the RX status |
| 15289 | during the consecutive sample hit*/ |
| 15290 | time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0xDF01000]. |
| 15291 | timestamp; |
| 15292 | |
| 15293 | /* ... set the processed flag to one */ |
| 15294 | L4_MABX_B.SFunction1_o5_g = 1.0; |
| 15295 | L4_MABX_B.SFunction1_o6_p = (real_T) |
| 15296 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0xDF01000].timestamp; |
| 15297 | L4_MABX_B.SFunction1_o7_m = (real_T) |
| 15298 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0xDF01000].deltatime; |
| 15299 | CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0xDF01000].data; |
| 15300 | |
| 15301 | /* Decode CAN message */ |
| 15302 | { |
| 15303 | { |
| 15304 | rtican_Signal_t CAN_Sgn; |
| 15305 | |
| 15306 | /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */ |
| 15307 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 15308 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15309 | L4_MABX_B.SFunction1_o1_mq = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15310 | |
| 15311 | /* ...... "Source" (8|4, standard signal, unsigned int, little endian) */ |
| 15312 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 15313 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 15314 | L4_MABX_B.SFunction1_o2_m = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15315 | |
| 15316 | /* ...... "Date" (16|16, standard signal, unsigned int, little endian) */ |
| 15317 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 15318 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 15319 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 15320 | L4_MABX_B.SFunction1_o3_l = ((real_T) CAN_Sgn.UnsignedSgn); |
| 15321 | |
| 15322 | /* ...... "Time" (32|32, standard signal, unsigned int, little endian) */ |
| 15323 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 15324 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 15325 | CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[6]; |
| 15326 | CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[7]; |
| 15327 | L4_MABX_B.SFunction1_o4_lz = 0.0001 * ( ((real_T) |
| 15328 | CAN_Sgn.UnsignedSgn) ); |
| 15329 | } |
| 15330 | } |
| 15331 | } else { |
| 15332 | /* set RX status to 0 because no new message has arrived */ |
| 15333 | L4_MABX_B.SFunction1_o5_g = 0.0; |
| 15334 | } |
| 15335 | } |
| 15336 | } |
| 15337 | |
| 15338 | /* End of Constant: '<S454>/Constant' */ |
| 15339 | /* End of Outputs for SubSystem: '<S638>/SystemTime_01' */ |
| 15340 | |
| 15341 | /* DataTypeConversion: '<S638>/Data Type Conversion8' */ |
| 15342 | L4_MABX_B.RX_status_i = (L4_MABX_B.SFunction1_o5_g != 0.0); |
| 15343 | |
| 15344 | /* Logic: '<S1068>/Operator' incorporates: |
| 15345 | * Constant: '<S1066>/Constant' |
| 15346 | */ |
| 15347 | L4_MABX_B.Operator_o5 = (L4_MABX_P.Constant_Value_fo && L4_MABX_B.RX_status_i); |
| 15348 | |
| 15349 | /* DataTypeConversion: '<S1068>/DataType' */ |
| 15350 | L4_MABX_B.DataType_ne = L4_MABX_B.Operator_o5; |
| 15351 | |
| 15352 | /* Outputs for Enabled SubSystem: '<S1067>/Std_SystemTime_01' incorporates: |
| 15353 | * EnablePort: '<S1069>/Enable' |
| 15354 | */ |
| 15355 | if (L4_MABX_B.DataType_ne) { |
| 15356 | /* S-Function (rti_commonblock): '<S1069>/S-Function1' incorporates: |
| 15357 | * Constant: '<S1067>/Constant' |
| 15358 | * Constant: '<S1067>/Constant1' |
| 15359 | */ |
| 15360 | /* This comment workarounds a code generation problem */ |
| 15361 | |
| 15362 | /* dSPACE RTICAN TX Message Block: "Std_SystemTime_01" Id:5 */ |
| 15363 | { |
| 15364 | static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 15365 | 0x00 }; |
| 15366 | |
| 15367 | Float32 delayTime = 0.0; |
| 15368 | |
| 15369 | /* link this pointer to CAN_Msg for use in initialize_io_units() */ |
| 15370 | CANTP1_PTR_M3_C2_STD_0x5 = &(CAN_Msg[0]); |
| 15371 | |
| 15372 | /* ... perform loop-back if required */ |
| 15373 | if (L4_MABX_P.Constant1_Value_gz > 0.5) { |
| 15374 | /* ... updating the used tx-clientbuffer */ |
| 15375 | can_tp1_msg_update_all( CANTP1_TX_M3_C2_MCRCLT_STD_0X5->module, |
| 15376 | CANTP1_TX_M3_C2_MCRCLT_STD_0X5->queue ); |
| 15377 | |
| 15378 | /* ... Read status and timestamp info perform loop-back (previous message) */ |
| 15379 | can_tp1_tx_msg_read_loopback(CANTP1_TX_M3_C2_MCRCLT_STD_0X5, |
| 15380 | 8, // datalen |
| 15381 | &(CAN_Msg[0]), |
| 15382 | CANTP1_RX_SPMSG_M3_C2_STD); |
| 15383 | |
| 15384 | /* Convert timestamp */ |
| 15385 | if (CANTP1_TX_M3_C2_MCRCLT_STD_0X5->processed) { |
| 15386 | CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp = |
| 15387 | rtk_dsts_time_to_simtime_convert |
| 15388 | (CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp); |
| 15389 | } |
| 15390 | } else { |
| 15391 | /* ... Read status and timestamp info (previous message) */ |
| 15392 | can_tp1_msg_read_from_dsmcr(CANTP1_TX_M3_C2_MCRCLT_STD_0X5); |
| 15393 | |
| 15394 | /* Convert timestamp */ |
| 15395 | if (CANTP1_TX_M3_C2_MCRCLT_STD_0X5->processed) { |
| 15396 | CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp = |
| 15397 | rtk_dsts_time_to_simtime_convert |
| 15398 | (CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp); |
| 15399 | } |
| 15400 | } |
| 15401 | |
| 15402 | /* Messages with timestamp zero have been received in pause/stop state |
| 15403 | and must not be handled. |
| 15404 | */ |
| 15405 | if (CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp > 0.0) { |
| 15406 | L4_MABX_B.SFunction1_o1_m = (real_T) |
| 15407 | CANTP1_TX_M3_C2_MCRCLT_STD_0X5->processed; |
| 15408 | L4_MABX_B.SFunction1_o2_g = (real_T) |
| 15409 | CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp; |
| 15410 | L4_MABX_B.SFunction1_o3 = (real_T) |
| 15411 | CANTP1_TX_M3_C2_MCRCLT_STD_0X5->deltatime; |
| 15412 | L4_MABX_B.SFunction1_o4 = (real_T) |
| 15413 | CANTP1_TX_M3_C2_MCRCLT_STD_0X5->delaytime; |
| 15414 | } |
| 15415 | |
| 15416 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 15417 | { |
| 15418 | rtican_Signal_t CAN_Sgn; |
| 15419 | UInt32 i; |
| 15420 | |
| 15421 | /* Initialize the static message data to zero */ |
| 15422 | for (i=0; i<8; i++ ) |
| 15423 | CAN_Msg[i] = 0; |
| 15424 | |
| 15425 | /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */ |
| 15426 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15427 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o1_mq ) + 0.5); |
| 15428 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15429 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 15430 | |
| 15431 | /* ...... "Source" (8|4, standard signal, unsigned int, little endian) */ |
| 15432 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15433 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o2_m ) + 0.5); |
| 15434 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 15435 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 15436 | |
| 15437 | /* ...... "Date" (16|16, standard signal, unsigned int, little endian) */ |
| 15438 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15439 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o3_l ) + 0.5); |
| 15440 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 15441 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 15442 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte1; |
| 15443 | |
| 15444 | /* ...... "Time" (32|32, standard signal, unsigned int, little endian) */ |
| 15445 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15446 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o4_lz - ( 0 ) ) / |
| 15447 | 0.0001 + 0.5); |
| 15448 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 15449 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte1; |
| 15450 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte2; |
| 15451 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte3; |
| 15452 | } |
| 15453 | |
| 15454 | delayTime = (Float32) L4_MABX_P.Constant_Value_ki / (2000); |
| 15455 | |
| 15456 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 15457 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X5], 8, &(CAN_Msg[0]), |
| 15458 | delayTime); |
| 15459 | } |
| 15460 | } |
| 15461 | |
| 15462 | /* End of Outputs for SubSystem: '<S1067>/Std_SystemTime_01' */ |
| 15463 | |
| 15464 | /* Constant: '<S1058>/Byte1' */ |
| 15465 | L4_MABX_B.VectorConcatenate[0] = L4_MABX_P.Byte1_Value_g; |
| 15466 | |
| 15467 | /* Constant: '<S1058>/Byte2' */ |
| 15468 | L4_MABX_B.VectorConcatenate[1] = L4_MABX_P.Byte2_Value_d; |
| 15469 | |
| 15470 | /* Constant: '<S1058>/Byte3' */ |
| 15471 | L4_MABX_B.VectorConcatenate[2] = L4_MABX_P.Byte3_Value_n; |
| 15472 | |
| 15473 | /* Constant: '<S1058>/Byte4' */ |
| 15474 | L4_MABX_B.VectorConcatenate[3] = L4_MABX_P.Byte4_Value_o; |
| 15475 | |
| 15476 | /* Constant: '<S1058>/Byte5' */ |
| 15477 | L4_MABX_B.VectorConcatenate[4] = L4_MABX_P.Byte5_Value_m; |
| 15478 | |
| 15479 | /* Constant: '<S1058>/Byte6' */ |
| 15480 | L4_MABX_B.VectorConcatenate[5] = L4_MABX_P.Byte6_Value_b; |
| 15481 | |
| 15482 | /* Constant: '<S1058>/Byte7' */ |
| 15483 | L4_MABX_B.VectorConcatenate[6] = L4_MABX_P.Byte7_Value_k; |
| 15484 | |
| 15485 | /* Constant: '<S1058>/Byte8' */ |
| 15486 | L4_MABX_B.VectorConcatenate[7] = L4_MABX_P.Byte8_Value_a; |
| 15487 | |
| 15488 | /* DataTypeConversion: '<S1062>/Data Type Conversion' */ |
| 15489 | for (i = 0; i < 8; i++) { |
| 15490 | L4_MABX_B.DataTypeConversion[i] = L4_MABX_B.VectorConcatenate[i]; |
| 15491 | } |
| 15492 | |
| 15493 | /* End of DataTypeConversion: '<S1062>/Data Type Conversion' */ |
| 15494 | |
| 15495 | /* UnitDelay: '<S859>/Unit Delay2' */ |
| 15496 | L4_MABX_B.UnitDelay2 = L4_MABX_DW.UnitDelay2_DSTATE; |
| 15497 | |
| 15498 | /* Outputs for Triggered SubSystem: '<S1062>/CAN_TYPE1_TX_M1_C1' incorporates: |
| 15499 | * TriggerPort: '<S1064>/Trigger' |
| 15500 | */ |
| 15501 | zcEvent = (L4_MABX_B.UnitDelay2 && |
| 15502 | (L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE_m != POS_ZCSIG)); |
| 15503 | if (zcEvent) { |
| 15504 | /* S-Function (rti_commonblock): '<S1064>/S-Function1' */ |
| 15505 | /* This comment workarounds a code generation problem */ |
| 15506 | |
| 15507 | /* dSPACE RTICAN TX Message Block: "TX Message" Id:418184965 */ |
| 15508 | { |
| 15509 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 15510 | |
| 15511 | Float32 delayTime = 0.0; |
| 15512 | |
| 15513 | /* ... Read status and timestamp info (previous message) */ |
| 15514 | can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]); |
| 15515 | |
| 15516 | /* Convert timestamp */ |
| 15517 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->processed) { |
| 15518 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->timestamp = |
| 15519 | rtk_dsts_time_to_simtime_convert |
| 15520 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->timestamp); |
| 15521 | } |
| 15522 | |
| 15523 | /* Messages with timestamp zero have been received in pause/stop state |
| 15524 | and must not be handled. |
| 15525 | */ |
| 15526 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->timestamp > 0.0) { |
| 15527 | L4_MABX_B.SFunction1_o1_n = (real_T) |
| 15528 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->processed; |
| 15529 | L4_MABX_B.SFunction1_o2_c = (real_T) |
| 15530 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->timestamp; |
| 15531 | L4_MABX_B.SFunction1_o3_k = (real_T) |
| 15532 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->deltatime; |
| 15533 | L4_MABX_B.SFunction1_o4_e = (real_T) |
| 15534 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->delaytime; |
| 15535 | } |
| 15536 | |
| 15537 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 15538 | { |
| 15539 | rtican_Signal_t CAN_Sgn; |
| 15540 | |
| 15541 | /* ...... "Byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 15542 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15543 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[0] ) + |
| 15544 | 0.5); |
| 15545 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15546 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 15547 | |
| 15548 | /* ...... "Byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 15549 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15550 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[1] ) + |
| 15551 | 0.5); |
| 15552 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15553 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 15554 | |
| 15555 | /* ...... "Byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 15556 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15557 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[2] ) + |
| 15558 | 0.5); |
| 15559 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15560 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 15561 | |
| 15562 | /* ...... "Byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 15563 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15564 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[3] ) + |
| 15565 | 0.5); |
| 15566 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15567 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 15568 | |
| 15569 | /* ...... "Byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 15570 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15571 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[4] ) + |
| 15572 | 0.5); |
| 15573 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15574 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 15575 | |
| 15576 | /* ...... "Byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 15577 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15578 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[5] ) + |
| 15579 | 0.5); |
| 15580 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15581 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 15582 | |
| 15583 | /* ...... "Byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 15584 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15585 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[6] ) + |
| 15586 | 0.5); |
| 15587 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15588 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 15589 | |
| 15590 | /* ...... "Byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 15591 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15592 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[7] ) + |
| 15593 | 0.5); |
| 15594 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15595 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 15596 | } |
| 15597 | |
| 15598 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 15599 | can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05], 8, |
| 15600 | &(CAN_Msg[0]), delayTime); |
| 15601 | } |
| 15602 | } |
| 15603 | |
| 15604 | L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE_m = L4_MABX_B.UnitDelay2; |
| 15605 | |
| 15606 | /* End of Outputs for SubSystem: '<S1062>/CAN_TYPE1_TX_M1_C1' */ |
| 15607 | |
| 15608 | /* UnitDelay: '<S859>/Unit Delay1' */ |
| 15609 | L4_MABX_B.UnitDelay1_b = L4_MABX_DW.UnitDelay1_DSTATE_b; |
| 15610 | |
| 15611 | /* MultiPortSwitch: '<S859>/Multiport Switch' incorporates: |
| 15612 | * Constant: '<S1060>/Byte1' |
| 15613 | * Constant: '<S1060>/Byte2' |
| 15614 | * Constant: '<S1060>/Byte3' |
| 15615 | * Constant: '<S1060>/Byte4' |
| 15616 | * Constant: '<S1060>/Byte5' |
| 15617 | * Constant: '<S1060>/Byte6' |
| 15618 | * Constant: '<S1060>/Byte7' |
| 15619 | * Constant: '<S1060>/Byte8' |
| 15620 | * Constant: '<S1061>/Byte1' |
| 15621 | * Constant: '<S1061>/Byte2' |
| 15622 | * Constant: '<S1061>/Byte3' |
| 15623 | * Constant: '<S1061>/Byte4' |
| 15624 | * Constant: '<S1061>/Byte5' |
| 15625 | * Constant: '<S1061>/Byte6' |
| 15626 | * Constant: '<S1061>/Byte7' |
| 15627 | * Constant: '<S1061>/Byte8' |
| 15628 | */ |
| 15629 | if (L4_MABX_B.UnitDelay1_b == 1) { |
| 15630 | L4_MABX_B.VectorConcatenate_b[7] = L4_MABX_P.Byte8_Value_g; |
| 15631 | L4_MABX_B.VectorConcatenate_b[6] = L4_MABX_P.Byte7_Value_d; |
| 15632 | L4_MABX_B.VectorConcatenate_b[5] = L4_MABX_P.Byte6_Value_g; |
| 15633 | L4_MABX_B.VectorConcatenate_b[4] = L4_MABX_P.Byte5_Value_k; |
| 15634 | L4_MABX_B.VectorConcatenate_b[3] = L4_MABX_P.Byte4_Value_k; |
| 15635 | L4_MABX_B.VectorConcatenate_b[2] = L4_MABX_P.Byte3_Value_o; |
| 15636 | L4_MABX_B.VectorConcatenate_b[1] = L4_MABX_P.Byte2_Value_f; |
| 15637 | L4_MABX_B.VectorConcatenate_b[0] = L4_MABX_P.Byte1_Value_e; |
| 15638 | for (i = 0; i < 8; i++) { |
| 15639 | L4_MABX_B.MultiportSwitch_ig[i] = L4_MABX_B.VectorConcatenate_b[i]; |
| 15640 | } |
| 15641 | } else { |
| 15642 | L4_MABX_B.VectorConcatenate_i[7] = L4_MABX_P.Byte8_Value; |
| 15643 | L4_MABX_B.VectorConcatenate_i[6] = L4_MABX_P.Byte7_Value; |
| 15644 | L4_MABX_B.VectorConcatenate_i[5] = L4_MABX_P.Byte6_Value; |
| 15645 | L4_MABX_B.VectorConcatenate_i[4] = L4_MABX_P.Byte5_Value; |
| 15646 | L4_MABX_B.VectorConcatenate_i[3] = L4_MABX_P.Byte4_Value; |
| 15647 | L4_MABX_B.VectorConcatenate_i[2] = L4_MABX_P.Byte3_Value; |
| 15648 | L4_MABX_B.VectorConcatenate_i[1] = L4_MABX_P.Byte2_Value; |
| 15649 | L4_MABX_B.VectorConcatenate_i[0] = L4_MABX_P.Byte1_Value; |
| 15650 | for (i = 0; i < 8; i++) { |
| 15651 | L4_MABX_B.MultiportSwitch_ig[i] = L4_MABX_B.VectorConcatenate_i[i]; |
| 15652 | } |
| 15653 | } |
| 15654 | |
| 15655 | /* End of MultiPortSwitch: '<S859>/Multiport Switch' */ |
| 15656 | |
| 15657 | /* DataTypeConversion: '<S1063>/Data Type Conversion' */ |
| 15658 | for (i = 0; i < 8; i++) { |
| 15659 | L4_MABX_B.DataTypeConversion_b[i] = L4_MABX_B.MultiportSwitch_ig[i]; |
| 15660 | } |
| 15661 | |
| 15662 | /* End of DataTypeConversion: '<S1063>/Data Type Conversion' */ |
| 15663 | |
| 15664 | /* UnitDelay: '<S859>/Unit Delay3' */ |
| 15665 | L4_MABX_B.UnitDelay3 = L4_MABX_DW.UnitDelay3_DSTATE; |
| 15666 | |
| 15667 | /* Outputs for Triggered SubSystem: '<S1063>/CAN_TYPE1_TX_M1_C1' incorporates: |
| 15668 | * TriggerPort: '<S1065>/Trigger' |
| 15669 | */ |
| 15670 | zcEvent = (L4_MABX_B.UnitDelay3 && |
| 15671 | (L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE != POS_ZCSIG)); |
| 15672 | if (zcEvent) { |
| 15673 | /* S-Function (rti_commonblock): '<S1065>/S-Function1' */ |
| 15674 | /* This comment workarounds a code generation problem */ |
| 15675 | |
| 15676 | /* dSPACE RTICAN TX Message Block: "TX Message" Id:418119429 */ |
| 15677 | { |
| 15678 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 15679 | |
| 15680 | Float32 delayTime = 0.0; |
| 15681 | |
| 15682 | /* ... Read status and timestamp info (previous message) */ |
| 15683 | can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]); |
| 15684 | |
| 15685 | /* Convert timestamp */ |
| 15686 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->processed) { |
| 15687 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->timestamp = |
| 15688 | rtk_dsts_time_to_simtime_convert |
| 15689 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->timestamp); |
| 15690 | } |
| 15691 | |
| 15692 | /* Messages with timestamp zero have been received in pause/stop state |
| 15693 | and must not be handled. |
| 15694 | */ |
| 15695 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->timestamp > 0.0) { |
| 15696 | L4_MABX_B.SFunction1_o1_h = (real_T) |
| 15697 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->processed; |
| 15698 | L4_MABX_B.SFunction1_o2_h = (real_T) |
| 15699 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->timestamp; |
| 15700 | L4_MABX_B.SFunction1_o3_g = (real_T) |
| 15701 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->deltatime; |
| 15702 | L4_MABX_B.SFunction1_o4_a = (real_T) |
| 15703 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->delaytime; |
| 15704 | } |
| 15705 | |
| 15706 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 15707 | { |
| 15708 | rtican_Signal_t CAN_Sgn; |
| 15709 | |
| 15710 | /* ...... "Byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 15711 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15712 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_b[0] ) + |
| 15713 | 0.5); |
| 15714 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15715 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 15716 | |
| 15717 | /* ...... "Byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 15718 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15719 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_b[1] ) + |
| 15720 | 0.5); |
| 15721 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15722 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 15723 | |
| 15724 | /* ...... "Byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 15725 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15726 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_b[2] ) + |
| 15727 | 0.5); |
| 15728 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15729 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 15730 | |
| 15731 | /* ...... "Byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 15732 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15733 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_b[3] ) + |
| 15734 | 0.5); |
| 15735 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15736 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 15737 | |
| 15738 | /* ...... "Byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 15739 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15740 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_b[4] ) + |
| 15741 | 0.5); |
| 15742 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15743 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 15744 | |
| 15745 | /* ...... "Byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 15746 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15747 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_b[5] ) + |
| 15748 | 0.5); |
| 15749 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15750 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 15751 | |
| 15752 | /* ...... "Byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 15753 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15754 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_b[6] ) + |
| 15755 | 0.5); |
| 15756 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15757 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 15758 | |
| 15759 | /* ...... "Byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 15760 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 15761 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_b[7] ) + |
| 15762 | 0.5); |
| 15763 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 15764 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 15765 | } |
| 15766 | |
| 15767 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 15768 | can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05], 8, |
| 15769 | &(CAN_Msg[0]), delayTime); |
| 15770 | } |
| 15771 | } |
| 15772 | |
| 15773 | L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE = L4_MABX_B.UnitDelay3; |
| 15774 | |
| 15775 | /* End of Outputs for SubSystem: '<S1063>/CAN_TYPE1_TX_M1_C1' */ |
| 15776 | |
| 15777 | /* Chart: '<S859>/Chart' incorporates: |
| 15778 | * Constant: '<S859>/Constant1' |
| 15779 | */ |
| 15780 | if (L4_MABX_DW.temporalCounter_i1_c < 255U) { |
| 15781 | L4_MABX_DW.temporalCounter_i1_c++; |
| 15782 | } |
| 15783 | |
| 15784 | /* Gateway: OUTPUTS_PIC_KW/CAN_Out_PIC_KW/CAN_TX_BAM/Chart */ |
| 15785 | /* During: OUTPUTS_PIC_KW/CAN_Out_PIC_KW/CAN_TX_BAM/Chart */ |
| 15786 | if (L4_MABX_DW.is_active_c4_SUB_ECU_L4_MABX_HW == 0U) { |
| 15787 | /* Entry: OUTPUTS_PIC_KW/CAN_Out_PIC_KW/CAN_TX_BAM/Chart */ |
| 15788 | L4_MABX_DW.is_active_c4_SUB_ECU_L4_MABX_HW = 1U; |
| 15789 | |
| 15790 | /* Entry Internal: OUTPUTS_PIC_KW/CAN_Out_PIC_KW/CAN_TX_BAM/Chart */ |
| 15791 | /* Transition: '<S1059>:4' */ |
| 15792 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_Init_i; |
| 15793 | |
| 15794 | /* Entry 'Init': '<S1059>:1' */ |
| 15795 | L4_MABX_B.State = 0U; |
| 15796 | L4_MABX_B.enTPCM = false; |
| 15797 | L4_MABX_B.enTPDT = false; |
| 15798 | L4_MABX_B.TPCM_ts_Prev = L4_MABX_B.SFunction1_o2_c; |
| 15799 | L4_MABX_B.TPDT_ts_Prev = L4_MABX_B.SFunction1_o2_h; |
| 15800 | L4_MABX_B.TPDT_count = 0U; |
| 15801 | } else { |
| 15802 | switch (L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf) { |
| 15803 | case L4_MABX_IN_CheckPacketCount: |
| 15804 | L4_MABX_B.State = 6U; |
| 15805 | |
| 15806 | /* During 'CheckPacketCount': '<S1059>:11' */ |
| 15807 | if (L4_MABX_B.TPDT_count <= L4_MABX_P.Constant1_Value_is) { |
| 15808 | /* Transition: '<S1059>:18' */ |
| 15809 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SendTPDT; |
| 15810 | L4_MABX_DW.temporalCounter_i1_c = 0U; |
| 15811 | |
| 15812 | /* Entry 'SendTPDT': '<S1059>:6' */ |
| 15813 | L4_MABX_B.State = 4U; |
| 15814 | L4_MABX_B.enTPDT = true; |
| 15815 | } else { |
| 15816 | /* Transition: '<S1059>:19' */ |
| 15817 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = |
| 15818 | L4_MABX_IN_WaitForNextPeriod; |
| 15819 | L4_MABX_DW.temporalCounter_i1_c = 0U; |
| 15820 | |
| 15821 | /* Entry 'WaitForNextPeriod': '<S1059>:17' */ |
| 15822 | L4_MABX_B.State = 7U; |
| 15823 | } |
| 15824 | break; |
| 15825 | |
| 15826 | case L4_MABX_IN_Init_i: |
| 15827 | /* During 'Init': '<S1059>:1' */ |
| 15828 | /* Transition: '<S1059>:9' */ |
| 15829 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_StartMsg; |
| 15830 | |
| 15831 | /* Entry 'StartMsg': '<S1059>:30' */ |
| 15832 | L4_MABX_B.State = 1U; |
| 15833 | L4_MABX_B.TPDT_count = 1U; |
| 15834 | break; |
| 15835 | |
| 15836 | case L4_MABX_IN_InterframeDelay: |
| 15837 | L4_MABX_B.State = 3U; |
| 15838 | |
| 15839 | /* During 'InterframeDelay': '<S1059>:7' */ |
| 15840 | if (L4_MABX_DW.temporalCounter_i1_c >= 5U) { |
| 15841 | /* Transition: '<S1059>:10' */ |
| 15842 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SendTPDT; |
| 15843 | L4_MABX_DW.temporalCounter_i1_c = 0U; |
| 15844 | |
| 15845 | /* Entry 'SendTPDT': '<S1059>:6' */ |
| 15846 | L4_MABX_B.State = 4U; |
| 15847 | L4_MABX_B.enTPDT = true; |
| 15848 | } |
| 15849 | break; |
| 15850 | |
| 15851 | case L4_MABX_IN_InterframeDelay1: |
| 15852 | L4_MABX_B.State = 5U; |
| 15853 | |
| 15854 | /* During 'InterframeDelay1': '<S1059>:12' */ |
| 15855 | if (L4_MABX_DW.temporalCounter_i1_c >= 5U) { |
| 15856 | /* Transition: '<S1059>:14' */ |
| 15857 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_CheckPacketCount; |
| 15858 | |
| 15859 | /* Entry 'CheckPacketCount': '<S1059>:11' */ |
| 15860 | L4_MABX_B.State = 6U; |
| 15861 | i = (int32_T)(L4_MABX_B.TPDT_count + 1U); |
| 15862 | if ((uint32_T)i > 255U) { |
| 15863 | i = 255; |
| 15864 | } |
| 15865 | |
| 15866 | L4_MABX_B.TPDT_count = (uint8_T)i; |
| 15867 | } |
| 15868 | break; |
| 15869 | |
| 15870 | case L4_MABX_IN_SendTPCM: |
| 15871 | L4_MABX_B.State = 2U; |
| 15872 | |
| 15873 | /* During 'SendTPCM': '<S1059>:5' */ |
| 15874 | if (L4_MABX_DW.temporalCounter_i1_c >= 1U) { |
| 15875 | /* Transition: '<S1059>:8' */ |
| 15876 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_InterframeDelay; |
| 15877 | L4_MABX_DW.temporalCounter_i1_c = 0U; |
| 15878 | |
| 15879 | /* Entry 'InterframeDelay': '<S1059>:7' */ |
| 15880 | L4_MABX_B.State = 3U; |
| 15881 | L4_MABX_B.enTPCM = false; |
| 15882 | L4_MABX_B.TPCM_ts_Prev = L4_MABX_B.SFunction1_o2_c; |
| 15883 | } |
| 15884 | break; |
| 15885 | |
| 15886 | case L4_MABX_IN_SendTPDT: |
| 15887 | L4_MABX_B.State = 4U; |
| 15888 | |
| 15889 | /* During 'SendTPDT': '<S1059>:6' */ |
| 15890 | if (L4_MABX_DW.temporalCounter_i1_c >= 1U) { |
| 15891 | /* Transition: '<S1059>:13' */ |
| 15892 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_InterframeDelay1; |
| 15893 | L4_MABX_DW.temporalCounter_i1_c = 0U; |
| 15894 | |
| 15895 | /* Entry 'InterframeDelay1': '<S1059>:12' */ |
| 15896 | L4_MABX_B.State = 5U; |
| 15897 | L4_MABX_B.enTPDT = false; |
| 15898 | L4_MABX_B.TPDT_ts_Prev = L4_MABX_B.SFunction1_o2_h; |
| 15899 | } |
| 15900 | break; |
| 15901 | |
| 15902 | case L4_MABX_IN_StartMsg: |
| 15903 | /* During 'StartMsg': '<S1059>:30' */ |
| 15904 | /* Transition: '<S1059>:31' */ |
| 15905 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SendTPCM; |
| 15906 | L4_MABX_DW.temporalCounter_i1_c = 0U; |
| 15907 | |
| 15908 | /* Entry 'SendTPCM': '<S1059>:5' */ |
| 15909 | L4_MABX_B.State = 2U; |
| 15910 | L4_MABX_B.enTPCM = true; |
| 15911 | break; |
| 15912 | |
| 15913 | default: |
| 15914 | L4_MABX_B.State = 7U; |
| 15915 | |
| 15916 | /* During 'WaitForNextPeriod': '<S1059>:17' */ |
| 15917 | if (L4_MABX_DW.temporalCounter_i1_c >= 185U) { |
| 15918 | /* Transition: '<S1059>:20' */ |
| 15919 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_StartMsg; |
| 15920 | |
| 15921 | /* Entry 'StartMsg': '<S1059>:30' */ |
| 15922 | L4_MABX_B.State = 1U; |
| 15923 | L4_MABX_B.TPDT_count = 1U; |
| 15924 | } |
| 15925 | break; |
| 15926 | } |
| 15927 | } |
| 15928 | |
| 15929 | /* End of Chart: '<S859>/Chart' */ |
| 15930 | |
| 15931 | /* RelationalOperator: '<S1087>/Operator' incorporates: |
| 15932 | * Constant: '<S1078>/Constant2' |
| 15933 | */ |
| 15934 | L4_MABX_B.Operator_ij = (L4_MABX_P.Constant2_Value_b4 == MABX_Mode); |
| 15935 | |
| 15936 | /* S-Function (rti_commonblock): '<S1070>/S-Function1' */ |
| 15937 | /* This comment workarounds a code generation problem */ |
| 15938 | |
| 15939 | /* write output state value to digital output channel 4 on port 1 */ |
| 15940 | dio_tp4_digout_write(DIO_TP4_1_MODULE_ADDR, 1, DIO_TP4_MASK_CH4, (UInt16) |
| 15941 | (L4_MABX_B.Operator_ij << 3)); |
| 15942 | |
| 15943 | /* RateTransition: '<S1078>/TmpRTBAtANDInport1' */ |
| 15944 | if (L4_MABX_M->Timing.RateInteraction.TID0_3 == 1) { |
| 15945 | L4_MABX_B.TmpRTBAtANDInport1 = L4_MABX_DW.TmpRTBAtANDInport1_Buffer0; |
| 15946 | } |
| 15947 | |
| 15948 | /* End of RateTransition: '<S1078>/TmpRTBAtANDInport1' */ |
| 15949 | |
| 15950 | /* Logic: '<S1078>/AND' */ |
| 15951 | L4_MABX_B.AND_mt = ((L4_MABX_B.TmpRTBAtANDInport1 != 0.0) && AutonomousEnabled); |
| 15952 | |
| 15953 | /* Logic: '<S1078>/OR' */ |
| 15954 | L4_MABX_B.OR = (AutonomousOutputEnabled || L4_MABX_B.AND_mt); |
| 15955 | |
| 15956 | /* S-Function (rti_commonblock): '<S1071>/S-Function1' */ |
| 15957 | /* This comment workarounds a code generation problem */ |
| 15958 | |
| 15959 | /* write output state value to digital output channel 2 on port 1 */ |
| 15960 | dio_tp4_digout_write(DIO_TP4_1_MODULE_ADDR, 1, DIO_TP4_MASK_CH2, (UInt16) |
| 15961 | (L4_MABX_B.OR << 1)); |
| 15962 | |
| 15963 | /* S-Function (rti_commonblock): '<S1072>/S-Function1' */ |
| 15964 | /* This comment workarounds a code generation problem */ |
| 15965 | |
| 15966 | /* write output state value to digital output channel 1 on port 1 */ |
| 15967 | dio_tp4_digout_write(DIO_TP4_1_MODULE_ADDR, 1, DIO_TP4_MASK_CH1, (UInt16) |
| 15968 | (EnableSw << 0)); |
| 15969 | |
| 15970 | /* RelationalOperator: '<S1086>/Operator' incorporates: |
| 15971 | * Constant: '<S1078>/Constant3' |
| 15972 | */ |
| 15973 | L4_MABX_B.Operator_olf = (L4_MABX_P.Constant3_Value_kw == SupervisorMode); |
| 15974 | |
| 15975 | /* S-Function (rti_commonblock): '<S1073>/S-Function1' */ |
| 15976 | /* This comment workarounds a code generation problem */ |
| 15977 | |
| 15978 | /* write output state value to digital output channel 3 on port 1 */ |
| 15979 | dio_tp4_digout_write(DIO_TP4_1_MODULE_ADDR, 1, DIO_TP4_MASK_CH3, (UInt16) |
| 15980 | (L4_MABX_B.Operator_olf << 2)); |
| 15981 | |
| 15982 | /* Logic: '<S1076>/Logical Operator' */ |
| 15983 | L4_MABX_B.LogicalOperator_cm = !AutonomousOutputEnabled; |
| 15984 | |
| 15985 | /* Outputs for Atomic SubSystem: '<S1076>/If_Then_Else4' */ |
| 15986 | |
| 15987 | /* Constant: '<S1076>/APTC_PEDAL_A_PWM_FREQ_HZ_APV' */ |
| 15988 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_cm, |
| 15989 | L4_MABX_B.Pedal_1_pwm_freq_raw_value, |
| 15990 | L4_MABX_P.APTC_PEDAL_A_PWM_FREQ_HZ_APV_Va, |
| 15991 | &L4_MABX_B.If_Then_Else4); |
| 15992 | |
| 15993 | /* End of Outputs for SubSystem: '<S1076>/If_Then_Else4' */ |
| 15994 | |
| 15995 | /* MinMax: '<S850>/MinMax' incorporates: |
| 15996 | * Constant: '<S850>/Constant2' |
| 15997 | */ |
| 15998 | DeltaTime = L4_MABX_B.If_Then_Else4.Switch; |
| 15999 | PositionFinalLimited = L4_MABX_P.Constant2_Value_a1; |
| 16000 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 16001 | PositionFinalLimited = DeltaTime; |
| 16002 | } |
| 16003 | |
| 16004 | L4_MABX_B.MinMax_f = PositionFinalLimited; |
| 16005 | |
| 16006 | /* End of MinMax: '<S850>/MinMax' */ |
| 16007 | |
| 16008 | /* DataTypeConversion: '<S850>/Data Type Conversion1' */ |
| 16009 | L4_MABX_B.DataTypeConversion1 = L4_MABX_B.MinMax_f; |
| 16010 | |
| 16011 | /* Product: '<S850>/Divide' incorporates: |
| 16012 | * Constant: '<S850>/Constant3' |
| 16013 | */ |
| 16014 | L4_MABX_B.Divide_c = L4_MABX_P.Constant3_Value_f / |
| 16015 | L4_MABX_B.DataTypeConversion1; |
| 16016 | |
| 16017 | /* DataTypeConversion: '<S850>/Data Type Conversion5' */ |
| 16018 | L4_MABX_B.PWMOut_P2C1_Period = L4_MABX_B.Divide_c; |
| 16019 | |
| 16020 | /* Lookup_n-D: '<S1076>/1-D Lookup Table2' */ |
| 16021 | L4_MABX_B.PedalPWMA_DC_out = look1_binlcapw(L4_MABX_B.If_Then_Else_f.Switch, |
| 16022 | L4_MABX_P.uDLookupTable2_bp01Data, L4_MABX_P.uDLookupTable2_tableData, 1U); |
| 16023 | |
| 16024 | /* Outputs for Atomic SubSystem: '<S1076>/If_Then_Else1' */ |
| 16025 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_cm, |
| 16026 | L4_MABX_B.Pedal_1_pwm_dc_raw_value, |
| 16027 | L4_MABX_B.PedalPWMA_DC_out, &L4_MABX_B.If_Then_Else1_c); |
| 16028 | |
| 16029 | /* End of Outputs for SubSystem: '<S1076>/If_Then_Else1' */ |
| 16030 | |
| 16031 | /* Gain: '<S850>/Gain1' */ |
| 16032 | L4_MABX_B.Gain1_a = L4_MABX_P.Gain1_Gain_mt * L4_MABX_B.If_Then_Else1_c.Switch; |
| 16033 | |
| 16034 | /* DataTypeConversion: '<S850>/Data Type Conversion6' */ |
| 16035 | L4_MABX_B.PWMOut_P2C1_DC = L4_MABX_B.Gain1_a; |
| 16036 | |
| 16037 | /* S-Function (rti_commonblock): '<S1074>/S-Function1' */ |
| 16038 | /* This comment workarounds a code generation problem */ |
| 16039 | |
| 16040 | /* write PWM Period and DutyCycle for output channel 1 on port 2 */ |
| 16041 | dio_tp4_pwm_update(DIO_TP4_1_MODULE_ADDR , 2, 1, (real_T) |
| 16042 | L4_MABX_B.PWMOut_P2C1_Period, (real_T) |
| 16043 | L4_MABX_B.PWMOut_P2C1_DC); |
| 16044 | |
| 16045 | /* Outputs for Atomic SubSystem: '<S1076>/If_Then_Else5' */ |
| 16046 | |
| 16047 | /* Constant: '<S1076>/APTC_PEDAL_B_PWM_FREQ_HZ_APV' */ |
| 16048 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_cm, |
| 16049 | L4_MABX_B.Pedal_2_pwm_freq_raw_value, |
| 16050 | L4_MABX_P.APTC_PEDAL_B_PWM_FREQ_HZ_APV_Va, |
| 16051 | &L4_MABX_B.If_Then_Else5); |
| 16052 | |
| 16053 | /* End of Outputs for SubSystem: '<S1076>/If_Then_Else5' */ |
| 16054 | |
| 16055 | /* MinMax: '<S850>/MinMax1' incorporates: |
| 16056 | * Constant: '<S850>/Constant4' |
| 16057 | */ |
| 16058 | DeltaTime = L4_MABX_B.If_Then_Else5.Switch; |
| 16059 | PositionFinalLimited = L4_MABX_P.Constant4_Value_k; |
| 16060 | if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) { |
| 16061 | PositionFinalLimited = DeltaTime; |
| 16062 | } |
| 16063 | |
| 16064 | L4_MABX_B.MinMax1_m = PositionFinalLimited; |
| 16065 | |
| 16066 | /* End of MinMax: '<S850>/MinMax1' */ |
| 16067 | |
| 16068 | /* DataTypeConversion: '<S850>/Data Type Conversion2' */ |
| 16069 | L4_MABX_B.DataTypeConversion2_c = L4_MABX_B.MinMax1_m; |
| 16070 | |
| 16071 | /* Product: '<S850>/Divide1' incorporates: |
| 16072 | * Constant: '<S850>/Constant1' |
| 16073 | */ |
| 16074 | L4_MABX_B.Divide1 = L4_MABX_P.Constant1_Value_e2 / |
| 16075 | L4_MABX_B.DataTypeConversion2_c; |
| 16076 | |
| 16077 | /* DataTypeConversion: '<S850>/Data Type Conversion9' */ |
| 16078 | L4_MABX_B.PWMOut_P2C2_Period = L4_MABX_B.Divide1; |
| 16079 | |
| 16080 | /* Lookup_n-D: '<S1076>/1-D Lookup Table3' */ |
| 16081 | L4_MABX_B.PedalPWMB_DC_out = look1_binlcapw(L4_MABX_B.If_Then_Else_f.Switch, |
| 16082 | L4_MABX_P.uDLookupTable3_bp01Data, L4_MABX_P.uDLookupTable3_tableData, 1U); |
| 16083 | |
| 16084 | /* Outputs for Atomic SubSystem: '<S1076>/If_Then_Else2' */ |
| 16085 | L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_cm, |
| 16086 | L4_MABX_B.Pedal_2_pwm_dc_raw_value, |
| 16087 | L4_MABX_B.PedalPWMB_DC_out, &L4_MABX_B.If_Then_Else2_p); |
| 16088 | |
| 16089 | /* End of Outputs for SubSystem: '<S1076>/If_Then_Else2' */ |
| 16090 | |
| 16091 | /* Gain: '<S850>/Gain' */ |
| 16092 | L4_MABX_B.Gain_i = L4_MABX_P.Gain_Gain_gx * L4_MABX_B.If_Then_Else2_p.Switch; |
| 16093 | |
| 16094 | /* DataTypeConversion: '<S850>/Data Type Conversion10' */ |
| 16095 | L4_MABX_B.PWMOut_P2C2_DC = L4_MABX_B.Gain_i; |
| 16096 | |
| 16097 | /* S-Function (rti_commonblock): '<S1075>/S-Function1' */ |
| 16098 | /* This comment workarounds a code generation problem */ |
| 16099 | |
| 16100 | /* write PWM Period and DutyCycle for output channel 2 on port 2 */ |
| 16101 | dio_tp4_pwm_update(DIO_TP4_1_MODULE_ADDR , 2, 2, (real_T) |
| 16102 | L4_MABX_B.PWMOut_P2C2_Period, (real_T) |
| 16103 | L4_MABX_B.PWMOut_P2C2_DC); |
| 16104 | |
| 16105 | /* S-Function (rti_commonblock): '<S739>/S-Function1' */ |
| 16106 | /* This comment workarounds a code generation problem */ |
| 16107 | |
| 16108 | /* Gain: '<S416>/ShifterControlDC' */ |
| 16109 | L4_MABX_B.ShiftControlDC = L4_MABX_P.ShifterControlDC_Gain * |
| 16110 | L4_MABX_B.SFunction1_o2_n; |
| 16111 | |
| 16112 | /* RelationalOperator: '<S1077>/Relational Operator' incorporates: |
| 16113 | * Constant: '<S1077>/Constant' |
| 16114 | */ |
| 16115 | L4_MABX_B.RelationalOperator_l = (L4_MABX_B.ShiftControlDC >= |
| 16116 | L4_MABX_P.Constant_Value_g4); |
| 16117 | |
| 16118 | /* RelationalOperator: '<S1077>/Relational Operator1' incorporates: |
| 16119 | * Constant: '<S1077>/Constant1' |
| 16120 | */ |
| 16121 | L4_MABX_B.RelationalOperator1_mb = (L4_MABX_B.ShiftControlDC <= |
| 16122 | L4_MABX_P.Constant1_Value_en); |
| 16123 | |
| 16124 | /* Logic: '<S1077>/Logical Operator' */ |
| 16125 | L4_MABX_B.LogicalOperator_g = (L4_MABX_B.RelationalOperator_l && |
| 16126 | L4_MABX_B.RelationalOperator1_mb); |
| 16127 | |
| 16128 | /* RelationalOperator: '<S1083>/Compare' incorporates: |
| 16129 | * Constant: '<S1083>/Constant' |
| 16130 | */ |
| 16131 | L4_MABX_B.Compare_m4 = (L4_MABX_B.SPN524_TransSelectedGear == |
| 16132 | L4_MABX_P.Constant_Value_i5); |
| 16133 | |
| 16134 | /* RelationalOperator: '<S1084>/Compare' incorporates: |
| 16135 | * Constant: '<S1084>/Constant' |
| 16136 | */ |
| 16137 | L4_MABX_B.Compare_g = (L4_MABX_B.SPN523_TransCurrentGear == |
| 16138 | L4_MABX_P.Constant_Value_d1); |
| 16139 | |
| 16140 | /* Logic: '<S1077>/Logical Operator1' */ |
| 16141 | L4_MABX_B.LogicalOperator1_i = (L4_MABX_B.Compare_m4 && L4_MABX_B.Compare_g); |
| 16142 | |
| 16143 | /* Outputs for Atomic SubSystem: '<S1077>/If_Then_Else' */ |
| 16144 | |
| 16145 | /* Constant: '<S1077>/F_ALLOW_ETC2_FOR_NEUTRAL_OUTPUT_APV' incorporates: |
| 16146 | * Constant: '<S1077>/Constant2' |
| 16147 | */ |
| 16148 | L4_MABX_If_Then_Else3(L4_MABX_P.F_ALLOW_ETC2_FOR_NEUTRAL_OUTPUT, |
| 16149 | L4_MABX_B.LogicalOperator1_i, |
| 16150 | L4_MABX_P.Constant2_Value_pa, &L4_MABX_B.If_Then_Else_ey); |
| 16151 | |
| 16152 | /* End of Outputs for SubSystem: '<S1077>/If_Then_Else' */ |
| 16153 | |
| 16154 | /* Logic: '<S1077>/Logical Operator2' */ |
| 16155 | L4_MABX_B.Neutral = (L4_MABX_B.LogicalOperator_g || |
| 16156 | L4_MABX_B.If_Then_Else_ey.Switch); |
| 16157 | |
| 16158 | /* Logic: '<S850>/Logical Operator' */ |
| 16159 | L4_MABX_B.LogicalOperator_f = !L4_MABX_B.Neutral; |
| 16160 | |
| 16161 | /* Outputs for Enabled SubSystem: '<S573>/GNSSDOPs_011' incorporates: |
| 16162 | * EnablePort: '<S574>/Enable' |
| 16163 | */ |
| 16164 | /* Constant: '<S441>/Constant' */ |
| 16165 | if (L4_MABX_P.Constant_Value_e1 > 0.0) { |
| 16166 | /* S-Function (rti_commonblock): '<S574>/S-Function1' */ |
| 16167 | /* This comment workarounds a code generation problem */ |
| 16168 | |
| 16169 | /* dSPACE RTICAN RX Message Block: "GNSSDOPs_01" Id:435815168 */ |
| 16170 | { |
| 16171 | UInt32 *CAN_Msg; |
| 16172 | static dsfloat time_old = 0.0; |
| 16173 | |
| 16174 | /* Read status and timestamp info (previous message) */ |
| 16175 | if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0300].timestamp != |
| 16176 | time_old) { |
| 16177 | /* ... save timestamp info for the calculation of the RX status |
| 16178 | during the consecutive sample hit*/ |
| 16179 | time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0300]. |
| 16180 | timestamp; |
| 16181 | |
| 16182 | /* ... set the processed flag to one */ |
| 16183 | L4_MABX_B.SFunction1_o7_id = 1.0; |
| 16184 | L4_MABX_B.SFunction1_o8_g = (real_T) |
| 16185 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0300].timestamp; |
| 16186 | L4_MABX_B.SFunction1_o9_a = (real_T) |
| 16187 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0300].deltatime; |
| 16188 | CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0300].data; |
| 16189 | |
| 16190 | /* Decode CAN message */ |
| 16191 | { |
| 16192 | { |
| 16193 | rtican_Signal_t CAN_Sgn; |
| 16194 | |
| 16195 | /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */ |
| 16196 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 16197 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 16198 | L4_MABX_B.SFunction1_o1_my = ((real_T) CAN_Sgn.UnsignedSgn); |
| 16199 | |
| 16200 | /* ...... "SetMode" (8|3, standard signal, unsigned int, little endian) */ |
| 16201 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 16202 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 16203 | L4_MABX_B.SFunction1_o2_ad = ((real_T) CAN_Sgn.UnsignedSgn); |
| 16204 | |
| 16205 | /* ...... "OpMode" (11|3, standard signal, unsigned int, little endian) */ |
| 16206 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 16207 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 3; |
| 16208 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 16209 | L4_MABX_B.SFunction1_o3_f3 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 16210 | |
| 16211 | /* ...... "HDOP_" (16|16, standard signal, signed int, little endian) */ |
| 16212 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 16213 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 16214 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 16215 | if (CAN_Sgn.SignedSgn >> 15) { |
| 16216 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 16217 | } |
| 16218 | |
| 16219 | L4_MABX_B.SFunction1_o4_e5 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 16220 | |
| 16221 | /* ...... "VDOP" (32|16, standard signal, signed int, little endian) */ |
| 16222 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 16223 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 16224 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 16225 | if (CAN_Sgn.SignedSgn >> 15) { |
| 16226 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 16227 | } |
| 16228 | |
| 16229 | L4_MABX_B.SFunction1_o5_b3 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 16230 | |
| 16231 | /* ...... "TDOP" (48|16, standard signal, signed int, little endian) */ |
| 16232 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 16233 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[7]; |
| 16234 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 16235 | if (CAN_Sgn.SignedSgn >> 15) { |
| 16236 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 16237 | } |
| 16238 | |
| 16239 | L4_MABX_B.SFunction1_o6_cz = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 16240 | } |
| 16241 | } |
| 16242 | } else { |
| 16243 | /* set RX status to 0 because no new message has arrived */ |
| 16244 | L4_MABX_B.SFunction1_o7_id = 0.0; |
| 16245 | } |
| 16246 | } |
| 16247 | } |
| 16248 | |
| 16249 | /* End of Outputs for SubSystem: '<S573>/GNSSDOPs_011' */ |
| 16250 | |
| 16251 | /* DataTypeConversion: '<S573>/Data Type Conversion8' */ |
| 16252 | L4_MABX_B.RX_status_ol = (L4_MABX_B.SFunction1_o7_id != 0.0); |
| 16253 | |
| 16254 | /* Outputs for Enabled SubSystem: '<S573>/GNSSDOPs_1' incorporates: |
| 16255 | * EnablePort: '<S575>/Enable' |
| 16256 | */ |
| 16257 | /* Constant: '<S441>/Constant' */ |
| 16258 | if (L4_MABX_P.Constant_Value_e1 > 0.0) { |
| 16259 | /* S-Function (rti_commonblock): '<S575>/S-Function1' */ |
| 16260 | /* This comment workarounds a code generation problem */ |
| 16261 | |
| 16262 | /* dSPACE RTICAN RX Message Block: "GNSSDOPs_01" Id:435815169 */ |
| 16263 | { |
| 16264 | UInt32 *CAN_Msg; |
| 16265 | static dsfloat time_old = 0.0; |
| 16266 | |
| 16267 | /* Read status and timestamp info (previous message) */ |
| 16268 | if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0301].timestamp != |
| 16269 | time_old) { |
| 16270 | /* ... save timestamp info for the calculation of the RX status |
| 16271 | during the consecutive sample hit*/ |
| 16272 | time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0301]. |
| 16273 | timestamp; |
| 16274 | |
| 16275 | /* ... set the processed flag to one */ |
| 16276 | L4_MABX_B.SFunction1_o7_g = 1.0; |
| 16277 | L4_MABX_B.SFunction1_o8_dj = (real_T) |
| 16278 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0301].timestamp; |
| 16279 | L4_MABX_B.SFunction1_o9_dx = (real_T) |
| 16280 | can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0301].deltatime; |
| 16281 | CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0301].data; |
| 16282 | |
| 16283 | /* Decode CAN message */ |
| 16284 | { |
| 16285 | { |
| 16286 | rtican_Signal_t CAN_Sgn; |
| 16287 | |
| 16288 | /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */ |
| 16289 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 16290 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 16291 | L4_MABX_B.SFunction1_o1_ks = ((real_T) CAN_Sgn.UnsignedSgn); |
| 16292 | |
| 16293 | /* ...... "SetMode" (8|3, standard signal, unsigned int, little endian) */ |
| 16294 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 16295 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 16296 | L4_MABX_B.SFunction1_o2_gq = ((real_T) CAN_Sgn.UnsignedSgn); |
| 16297 | |
| 16298 | /* ...... "OpMode" (11|3, standard signal, unsigned int, little endian) */ |
| 16299 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 16300 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 3; |
| 16301 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 16302 | L4_MABX_B.SFunction1_o3_id = ((real_T) CAN_Sgn.UnsignedSgn); |
| 16303 | |
| 16304 | /* ...... "HDOP_" (16|16, standard signal, signed int, little endian) */ |
| 16305 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 16306 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 16307 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 16308 | if (CAN_Sgn.SignedSgn >> 15) { |
| 16309 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 16310 | } |
| 16311 | |
| 16312 | L4_MABX_B.SFunction1_o4_e1 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 16313 | |
| 16314 | /* ...... "VDOP" (32|16, standard signal, signed int, little endian) */ |
| 16315 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 16316 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 16317 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 16318 | if (CAN_Sgn.SignedSgn >> 15) { |
| 16319 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 16320 | } |
| 16321 | |
| 16322 | L4_MABX_B.SFunction1_o5_cs = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 16323 | |
| 16324 | /* ...... "TDOP" (48|16, standard signal, signed int, little endian) */ |
| 16325 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 16326 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[7]; |
| 16327 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 16328 | if (CAN_Sgn.SignedSgn >> 15) { |
| 16329 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 16330 | } |
| 16331 | |
| 16332 | L4_MABX_B.SFunction1_o6_na = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 16333 | } |
| 16334 | } |
| 16335 | } else { |
| 16336 | /* set RX status to 0 because no new message has arrived */ |
| 16337 | L4_MABX_B.SFunction1_o7_g = 0.0; |
| 16338 | } |
| 16339 | } |
| 16340 | } |
| 16341 | |
| 16342 | /* End of Outputs for SubSystem: '<S573>/GNSSDOPs_1' */ |
| 16343 | |
| 16344 | /* Switch: '<S573>/Switch' */ |
| 16345 | if (L4_MABX_B.RX_status_ol) { |
| 16346 | L4_MABX_B.HDOP_ = L4_MABX_B.SFunction1_o4_e5; |
| 16347 | } else { |
| 16348 | L4_MABX_B.HDOP_ = L4_MABX_B.SFunction1_o4_e1; |
| 16349 | } |
| 16350 | |
| 16351 | /* Outputs for Atomic SubSystem: '<S65>/Task_20ms' */ |
| 16352 | /* RateTransition: '<S395>/TmpRTBAtCheckHDOPInport1' */ |
| 16353 | if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) { |
| 16354 | L4_MABX_B.HDOP__f = L4_MABX_B.HDOP_; |
| 16355 | L4_MABX_B.FrontAxleSpeed_d = L4_MABX_B.SFunction1_o1_ee; |
| 16356 | L4_MABX_B.FrontAxleSpeed_dv = L4_MABX_B.SFunction1_o1_ee; |
| 16357 | L4_MABX_B.FrontAxleSpeed_dvq = L4_MABX_B.SFunction1_o1_ee; |
| 16358 | L4_MABX_B.TmpRTBAtVehHeadingInport1 = YawRate; |
| 16359 | } |
| 16360 | |
| 16361 | /* End of RateTransition: '<S395>/TmpRTBAtCheckHDOPInport1' */ |
| 16362 | /* End of Outputs for SubSystem: '<S65>/Task_20ms' */ |
| 16363 | |
| 16364 | /* Switch: '<S397>/Switch2' incorporates: |
| 16365 | * Constant: '<S397>/No Data' |
| 16366 | * Switch: '<S397>/Switch6' |
| 16367 | * Switch: '<S397>/Switch7' |
| 16368 | * Switch: '<S397>/Switch8' |
| 16369 | */ |
| 16370 | if (RTMapsOk) { |
| 16371 | /* Gain: '<S397>/m//s_to_km//h' */ |
| 16372 | L4_MABX_B.ms_to_kmh = L4_MABX_P.ms_to_kmh_Gain * |
| 16373 | L4_MABX_B.Decoder_o1.CurrentVelocity; |
| 16374 | CurrentVelocity_kph = L4_MABX_B.ms_to_kmh; |
| 16375 | |
| 16376 | /* Gain: '<S397>/for_logging4' */ |
| 16377 | L4_MABX_B.for_logging4 = L4_MABX_P.for_logging4_Gain * |
| 16378 | L4_MABX_B.Decoder_o1.GPS_X; |
| 16379 | GPS_X = L4_MABX_B.for_logging4; |
| 16380 | |
| 16381 | /* Gain: '<S397>/for_logging5' */ |
| 16382 | L4_MABX_B.for_logging5 = L4_MABX_P.for_logging5_Gain * |
| 16383 | L4_MABX_B.Decoder_o1.GPS_Y; |
| 16384 | GPS_Y = L4_MABX_B.for_logging5; |
| 16385 | |
| 16386 | /* Gain: '<S397>/for_logging6' */ |
| 16387 | L4_MABX_B.for_logging6 = L4_MABX_P.for_logging6_Gain * |
| 16388 | L4_MABX_B.Decoder_o1.GPS_Time; |
| 16389 | GPS_Time = L4_MABX_B.for_logging6; |
| 16390 | } else { |
| 16391 | CurrentVelocity_kph = L4_MABX_P.NoData_Value; |
| 16392 | GPS_X = L4_MABX_P.NoData_Value; |
| 16393 | GPS_Y = L4_MABX_P.NoData_Value; |
| 16394 | GPS_Time = L4_MABX_P.NoData_Value; |
| 16395 | } |
| 16396 | |
| 16397 | /* End of Switch: '<S397>/Switch2' */ |
| 16398 | |
| 16399 | /* S-Function (rti_commonblock): '<S408>/S-Function1' */ |
| 16400 | |
| 16401 | /* This comment workarounds a code generation problem */ |
| 16402 | |
| 16403 | /* End of Outputs for S-Function (rti_commonblock): '<S408>/S-Function1' */ |
| 16404 | |
| 16405 | /* S-Function (rti_commonblock): '<S414>/S-Function1' */ |
| 16406 | |
| 16407 | /* This comment workarounds a code generation problem */ |
| 16408 | |
| 16409 | /* End of Outputs for S-Function (rti_commonblock): '<S414>/S-Function1' */ |
| 16410 | |
| 16411 | /* S-Function (rti_commonblock): '<S399>/TRC Exclusion' */ |
| 16412 | /* This comment workarounds a code generation problem */ |
| 16413 | |
| 16414 | /* S-Function (rti_commonblock): '<S400>/TRC Exclusion' */ |
| 16415 | /* This comment workarounds a code generation problem */ |
| 16416 | |
| 16417 | /* UnitDelay: '<S3>/Unit_Delay' */ |
| 16418 | L4_MABX_B.DesSteeringAngle = L4_MABX_DW.Unit_Delay_1_DSTATE; |
| 16419 | L4_MABX_B.Stanley_axleAngle2 = L4_MABX_DW.Unit_Delay_10_DSTATE; |
| 16420 | L4_MABX_B.DriversDemandEngPercentTorque = L4_MABX_DW.Unit_Delay_100_DSTATE; |
| 16421 | L4_MABX_B.SPN514_NominalFrictionPercent_g = L4_MABX_DW.Unit_Delay_101_DSTATE; |
| 16422 | L4_MABX_B.SPN2978_EstEngParasiticLosses_m = L4_MABX_DW.Unit_Delay_102_DSTATE; |
| 16423 | L4_MABX_B.SPN1760_GrossCombinationVehic_h = L4_MABX_DW.Unit_Delay_103_DSTATE; |
| 16424 | L4_MABX_B.ACCDistanceAlertSignal_o = L4_MABX_DW.Unit_Delay_104_DSTATE; |
| 16425 | L4_MABX_B.ForwardCollisionWarning_c = L4_MABX_DW.Unit_Delay_105_DSTATE; |
| 16426 | L4_MABX_B.SPN544_EngineReferenceTorque_g = L4_MABX_DW.Unit_Delay_106_DSTATE; |
| 16427 | L4_MABX_B.ROPEngCtrlActive = L4_MABX_DW.Unit_Delay_107_DSTATE; |
| 16428 | L4_MABX_B.ROPBrakeCtrlActive = L4_MABX_DW.Unit_Delay_108_DSTATE; |
| 16429 | L4_MABX_B.YCEngCtrlActive = L4_MABX_DW.Unit_Delay_109_DSTATE; |
| 16430 | L4_MABX_B.DesSteeringAngleTerm = L4_MABX_DW.Unit_Delay_11_DSTATE; |
| 16431 | L4_MABX_B.YCBrakeCtrlActive = L4_MABX_DW.Unit_Delay_110_DSTATE; |
| 16432 | L4_MABX_B.SPN1807_SteeringWheelAngle = L4_MABX_DW.Unit_Delay_111_DSTATE; |
| 16433 | L4_MABX_B.SPN1808_YawRate = L4_MABX_DW.Unit_Delay_112_DSTATE; |
| 16434 | L4_MABX_B.SPN1810_LongitudinalAcceleratio = L4_MABX_DW.Unit_Delay_113_DSTATE; |
| 16435 | L4_MABX_B.SteerWheelTurnCounter = L4_MABX_DW.Unit_Delay_114_DSTATE; |
| 16436 | L4_MABX_B.SteerWheelAngleSensorType = L4_MABX_DW.Unit_Delay_115_DSTATE; |
| 16437 | L4_MABX_B.LateralAcceleration = L4_MABX_DW.Unit_Delay_116_DSTATE; |
| 16438 | L4_MABX_B.BarometricPress = L4_MABX_DW.Unit_Delay_117_DSTATE; |
| 16439 | L4_MABX_B.AmbientAirTemp = L4_MABX_DW.Unit_Delay_118_DSTATE; |
| 16440 | L4_MABX_B.F_Truck1571_VIN_Match = L4_MABX_DW.Unit_Delay_119_DSTATE; |
| 16441 | L4_MABX_B.DesSteeringDistTerm = L4_MABX_DW.Unit_Delay_12_DSTATE; |
| 16442 | L4_MABX_B.F_Truck166_VIN_Match = L4_MABX_DW.Unit_Delay_120_DSTATE; |
| 16443 | L4_MABX_B.PitchAngleExRange_m = L4_MABX_DW.Unit_Delay_121_DSTATE; |
| 16444 | L4_MABX_B.PX2_LanePosEstPosition = L4_MABX_DW.Unit_Delay_122_DSTATE; |
| 16445 | L4_MABX_B.PX2_LanePosEstAngle = L4_MABX_DW.Unit_Delay_123_DSTATE; |
| 16446 | L4_MABX_B.PX2_LanePosEstNumPoints = L4_MABX_DW.Unit_Delay_124_DSTATE; |
| 16447 | L4_MABX_B.Latitude__c = L4_MABX_DW.Unit_Delay_125_DSTATE; |
| 16448 | L4_MABX_B.Longitude__m = L4_MABX_DW.Unit_Delay_126_DSTATE; |
| 16449 | L4_MABX_B.HDOP__o = L4_MABX_DW.Unit_Delay_127_DSTATE; |
| 16450 | L4_MABX_B.XPRControlMode_d = L4_MABX_DW.Unit_Delay_128_DSTATE; |
| 16451 | L4_MABX_B.XPRErrorState_d = L4_MABX_DW.Unit_Delay_129_DSTATE; |
| 16452 | L4_MABX_B.numLanePoints = L4_MABX_DW.Unit_Delay_13_DSTATE; |
| 16453 | L4_MABX_B.PressureP1_a = L4_MABX_DW.Unit_Delay_130_DSTATE; |
| 16454 | L4_MABX_B.PressureP4_h = L4_MABX_DW.Unit_Delay_131_DSTATE; |
| 16455 | L4_MABX_B.PressureP21_b = L4_MABX_DW.Unit_Delay_132_DSTATE; |
| 16456 | L4_MABX_B.PressureP22_e = L4_MABX_DW.Unit_Delay_133_DSTATE; |
| 16457 | L4_MABX_B.PressureP42_n = L4_MABX_DW.Unit_Delay_134_DSTATE; |
| 16458 | L4_MABX_B.ReAX_ActualHandwheelPos_p = L4_MABX_DW.Unit_Delay_135_DSTATE; |
| 16459 | L4_MABX_B.ReAX_EchoedSteerWheelPos_p = L4_MABX_DW.Unit_Delay_136_DSTATE; |
| 16460 | L4_MABX_B.SystemsOk_a = L4_MABX_DW.Unit_Delay_137_DSTATE; |
| 16461 | L4_MABX_B.SupervisorMode_l = L4_MABX_DW.Unit_Delay_138_DSTATE; |
| 16462 | L4_MABX_B.CurrentAzimuth_rad_k = L4_MABX_DW.Unit_Delay_139_DSTATE; |
| 16463 | L4_MABX_B.rawPositionError = L4_MABX_DW.Unit_Delay_14_DSTATE; |
| 16464 | L4_MABX_B.TargetAzimuth_rad_i = L4_MABX_DW.Unit_Delay_140_DSTATE; |
| 16465 | L4_MABX_B.CurrentVelocity_kph_k = L4_MABX_DW.Unit_Delay_141_DSTATE; |
| 16466 | L4_MABX_B.TargetVelocity_kph_m = L4_MABX_DW.Unit_Delay_142_DSTATE; |
| 16467 | L4_MABX_B.Curvature_a = L4_MABX_DW.Unit_Delay_143_DSTATE; |
| 16468 | L4_MABX_B.CrosstrackError_n = L4_MABX_DW.Unit_Delay_144_DSTATE; |
| 16469 | L4_MABX_B.slewedPosError = L4_MABX_DW.Unit_Delay_15_DSTATE; |
| 16470 | L4_MABX_B.previewSteeringAngle = L4_MABX_DW.Unit_Delay_16_DSTATE; |
| 16471 | L4_MABX_B.APTC_Pedal_torque_dem_value = L4_MABX_DW.Unit_Delay_17_DSTATE; |
| 16472 | L4_MABX_B.APTC_arb_pedal_low_idl_sw = L4_MABX_DW.Unit_Delay_18_DSTATE; |
| 16473 | L4_MABX_B.APTC_arb_pedal_position = L4_MABX_DW.Unit_Delay_19_DSTATE; |
| 16474 | L4_MABX_B.DesSteeringPID_Dterm = L4_MABX_DW.Unit_Delay_2_DSTATE; |
| 16475 | L4_MABX_B.signal1 = L4_MABX_DW.Unit_Delay_20_DSTATE; |
| 16476 | L4_MABX_B.PID_output = L4_MABX_DW.Unit_Delay_21_DSTATE; |
| 16477 | L4_MABX_B.PID_output_unlim = L4_MABX_DW.Unit_Delay_22_DSTATE; |
| 16478 | L4_MABX_B.PID_control_error = L4_MABX_DW.Unit_Delay_23_DSTATE; |
| 16479 | L4_MABX_B.PID_p_term = L4_MABX_DW.Unit_Delay_24_DSTATE; |
| 16480 | L4_MABX_B.PID_i_term = L4_MABX_DW.Unit_Delay_25_DSTATE; |
| 16481 | L4_MABX_B.PID_d_term = L4_MABX_DW.Unit_Delay_26_DSTATE; |
| 16482 | L4_MABX_B.PID_hold_i_term_f = L4_MABX_DW.Unit_Delay_27_DSTATE; |
| 16483 | L4_MABX_B.ThrottlePID_Y = L4_MABX_DW.Unit_Delay_28_DSTATE; |
| 16484 | L4_MABX_B.EngineSpeedTarget_Y = L4_MABX_DW.Unit_Delay_29_DSTATE; |
| 16485 | L4_MABX_B.DesSteeringPID_Iterm = L4_MABX_DW.Unit_Delay_3_DSTATE; |
| 16486 | L4_MABX_B.F_Ignition_relay_command = L4_MABX_DW.Unit_Delay_30_DSTATE; |
| 16487 | L4_MABX_B.F_Inverter_relay_command = L4_MABX_DW.Unit_Delay_31_DSTATE; |
| 16488 | L4_MABX_B.F_MABX_relay_command = L4_MABX_DW.Unit_Delay_32_DSTATE; |
| 16489 | L4_MABX_B.F_Sensor_relay_command = L4_MABX_DW.Unit_Delay_33_DSTATE; |
| 16490 | L4_MABX_B.BrkPedArbBrakeSwitch = L4_MABX_DW.Unit_Delay_34_DSTATE; |
| 16491 | L4_MABX_B.Accel_rate_ms2 = L4_MABX_DW.Unit_Delay_35_DSTATE; |
| 16492 | L4_MABX_B.BrakingControlActive = L4_MABX_DW.Unit_Delay_36_DSTATE; |
| 16493 | L4_MABX_B.F_Hold_brakes_at_zero = L4_MABX_DW.Unit_Delay_37_DSTATE; |
| 16494 | L4_MABX_B.BrakingPID_Y = L4_MABX_DW.Unit_Delay_38_DSTATE; |
| 16495 | L4_MABX_B.BrakingPID_Y_Direct_Pressure = L4_MABX_DW.Unit_Delay_39_DSTATE; |
| 16496 | L4_MABX_B.DesSteeringPID_Pterm = L4_MABX_DW.Unit_Delay_4_DSTATE; |
| 16497 | L4_MABX_B.VSPD_TARGET_KPH_APV_h = L4_MABX_DW.Unit_Delay_40_DSTATE; |
| 16498 | L4_MABX_B.Vehicle_speed_target = L4_MABX_DW.Unit_Delay_41_DSTATE; |
| 16499 | L4_MABX_B.VSPD_HYST_KPH_APV = L4_MABX_DW.Unit_Delay_42_DSTATE; |
| 16500 | L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_APV = L4_MABX_DW.Unit_Delay_43_DSTATE; |
| 16501 | L4_MABX_B.ACCEL_LIM_MS2_APV = L4_MABX_DW.Unit_Delay_44_DSTATE; |
| 16502 | L4_MABX_B.AutonomousOutputEnabled_n = L4_MABX_DW.Unit_Delay_46_DSTATE; |
| 16503 | L4_MABX_B.DesSteeringPID_Y = L4_MABX_DW.Unit_Delay_5_DSTATE; |
| 16504 | L4_MABX_B.DesSteeringPID_e = L4_MABX_DW.Unit_Delay_6_DSTATE; |
| 16505 | L4_MABX_B.DeSteeringPID_Y2 = L4_MABX_DW.Unit_Delay_7_DSTATE; |
| 16506 | L4_MABX_B.CurvatureEst = L4_MABX_DW.Unit_Delay_8_DSTATE; |
| 16507 | L4_MABX_B.EngagePB_g = L4_MABX_DW.Unit_Delay_82_DSTATE; |
| 16508 | L4_MABX_B.PedalPWMPos = L4_MABX_DW.Unit_Delay_85_DSTATE; |
| 16509 | L4_MABX_B.IgnitionKeySwitch_voltage_c = L4_MABX_DW.Unit_Delay_86_DSTATE; |
| 16510 | L4_MABX_B.BrakeSwitch_a = L4_MABX_DW.Unit_Delay_87_DSTATE; |
| 16511 | L4_MABX_B.Park_brake_switch = L4_MABX_DW.Unit_Delay_88_DSTATE; |
| 16512 | L4_MABX_B.CruiseCtrlEnableSwitch = L4_MABX_DW.Unit_Delay_89_DSTATE; |
| 16513 | L4_MABX_B.Stanley_axleAngle = L4_MABX_DW.Unit_Delay_9_DSTATE; |
| 16514 | L4_MABX_B.FrontAxleSpeed = L4_MABX_DW.Unit_Delay_90_DSTATE; |
| 16515 | L4_MABX_B.FrontAxleLeftWheelSpeed = L4_MABX_DW.Unit_Delay_91_DSTATE; |
| 16516 | L4_MABX_B.FrontAxleRightWheelSpeed = L4_MABX_DW.Unit_Delay_92_DSTATE; |
| 16517 | L4_MABX_B.EBSBrakeSwitch = L4_MABX_DW.Unit_Delay_93_DSTATE; |
| 16518 | L4_MABX_B.SPN524_TransSelectedGear_m = L4_MABX_DW.Unit_Delay_94_DSTATE; |
| 16519 | L4_MABX_B.SPN523_TransCurrentGear_n = L4_MABX_DW.Unit_Delay_95_DSTATE; |
| 16520 | L4_MABX_B.SPN526_TransActualGearRatio_f = L4_MABX_DW.Unit_Delay_96_DSTATE; |
| 16521 | L4_MABX_B.ActualEngPercentTorque = L4_MABX_DW.Unit_Delay_97_DSTATE; |
| 16522 | L4_MABX_B.ActlEngPrcntTrqueHighResolution = L4_MABX_DW.Unit_Delay_98_DSTATE; |
| 16523 | L4_MABX_B.EngSpeed = L4_MABX_DW.Unit_Delay_99_DSTATE; |
| 16524 | |
| 16525 | /* DataTypeConversion: '<S526>/Data Type Conversion' */ |
| 16526 | L4_MABX_B.DataTypeConversion_az = L4_MABX_B.DataTypeConversion_go[0]; |
| 16527 | |
| 16528 | /* DataTypeConversion: '<S526>/Data Type Conversion1' */ |
| 16529 | L4_MABX_B.DataTypeConversion1_fy = L4_MABX_B.DataTypeConversion_go[1]; |
| 16530 | |
| 16531 | /* ArithShift: '<S526>/Shift Arithmetic' */ |
| 16532 | L4_MABX_B.ShiftArithmetic_h = (uint16_T)(L4_MABX_B.DataTypeConversion1_fy << 8); |
| 16533 | |
| 16534 | /* S-Function (sfix_bitop): '<S553>/Operator' */ |
| 16535 | L4_MABX_B.Operator_khw = (uint16_T)(L4_MABX_B.DataTypeConversion_az | |
| 16536 | L4_MABX_B.ShiftArithmetic_h); |
| 16537 | |
| 16538 | /* DataTypeConversion: '<S553>/DataType' */ |
| 16539 | L4_MABX_B.DataType_jo = L4_MABX_B.Operator_khw; |
| 16540 | |
| 16541 | /* DataTypeConversion: '<S526>/Data Type Conversion2' */ |
| 16542 | L4_MABX_B.DataTypeConversion2_p = L4_MABX_B.DataType_jo; |
| 16543 | |
| 16544 | /* Product: '<S526>/Product' incorporates: |
| 16545 | * Constant: '<S526>/Constant' |
| 16546 | */ |
| 16547 | L4_MABX_B.SPN188_EngineSpeedAtIdlePoint1 = L4_MABX_B.DataTypeConversion2_p * |
| 16548 | L4_MABX_P.Constant_Value_ch; |
| 16549 | |
| 16550 | /* DataTypeConversion: '<S418>/Data Type Conversion' */ |
| 16551 | L4_MABX_B.DataTypeConversion_k = L4_MABX_B.SPN188_EngineSpeedAtIdlePoint1; |
| 16552 | |
| 16553 | /* DataTypeConversion: '<S533>/Data Type Conversion' */ |
| 16554 | L4_MABX_B.DataTypeConversion_bb = L4_MABX_B.DataTypeConversion_go[2]; |
| 16555 | |
| 16556 | /* Sum: '<S533>/Add' incorporates: |
| 16557 | * Constant: '<S533>/Constant' |
| 16558 | */ |
| 16559 | L4_MABX_B.SPN539_EnginePercentTorqueAtIdl = L4_MABX_B.DataTypeConversion_bb + |
| 16560 | L4_MABX_P.Constant_Value_ej; |
| 16561 | |
| 16562 | /* DataTypeConversion: '<S418>/Data Type Conversion1' */ |
| 16563 | L4_MABX_B.DataTypeConversion1_j = L4_MABX_B.SPN539_EnginePercentTorqueAtIdl; |
| 16564 | |
| 16565 | /* DataTypeConversion: '<S530>/Data Type Conversion' */ |
| 16566 | L4_MABX_B.DataTypeConversion_kb = L4_MABX_B.DataTypeConversion_go[15]; |
| 16567 | |
| 16568 | /* DataTypeConversion: '<S530>/Data Type Conversion1' */ |
| 16569 | L4_MABX_B.DataTypeConversion1_ia = L4_MABX_B.DataTypeConversion_go[16]; |
| 16570 | |
| 16571 | /* ArithShift: '<S530>/Shift Arithmetic' */ |
| 16572 | L4_MABX_B.ShiftArithmetic_n = (uint16_T)(L4_MABX_B.DataTypeConversion1_ia << 8); |
| 16573 | |
| 16574 | /* S-Function (sfix_bitop): '<S555>/Operator' */ |
| 16575 | L4_MABX_B.Operator_eq = (uint16_T)(L4_MABX_B.DataTypeConversion_kb | |
| 16576 | L4_MABX_B.ShiftArithmetic_n); |
| 16577 | |
| 16578 | /* DataTypeConversion: '<S555>/DataType' */ |
| 16579 | L4_MABX_B.DataType_mr = L4_MABX_B.Operator_eq; |
| 16580 | |
| 16581 | /* DataTypeConversion: '<S530>/Data Type Conversion2' */ |
| 16582 | L4_MABX_B.DataTypeConversion2_o = L4_MABX_B.DataType_mr; |
| 16583 | |
| 16584 | /* Product: '<S530>/Product' incorporates: |
| 16585 | * Constant: '<S530>/Constant' |
| 16586 | */ |
| 16587 | L4_MABX_B.SPN532_EngineSpeedAtHighIdlePoi = L4_MABX_B.DataTypeConversion2_o * |
| 16588 | L4_MABX_P.Constant_Value_d2; |
| 16589 | |
| 16590 | /* DataTypeConversion: '<S418>/Data Type Conversion10' */ |
| 16591 | L4_MABX_B.DataTypeConversion10 = L4_MABX_B.SPN532_EngineSpeedAtHighIdlePoi; |
| 16592 | |
| 16593 | /* DataTypeConversion: '<S531>/Data Type Conversion1' */ |
| 16594 | L4_MABX_B.DataTypeConversion1_n3 = L4_MABX_B.DataTypeConversion_go[17]; |
| 16595 | |
| 16596 | /* DataTypeConversion: '<S531>/Data Type Conversion3' */ |
| 16597 | L4_MABX_B.DataTypeConversion3_mx = L4_MABX_B.DataTypeConversion_go[18]; |
| 16598 | |
| 16599 | /* ArithShift: '<S531>/Shift Arithmetic' */ |
| 16600 | L4_MABX_B.ShiftArithmetic_j = (uint16_T)(L4_MABX_B.DataTypeConversion3_mx << 8); |
| 16601 | |
| 16602 | /* S-Function (sfix_bitop): '<S556>/Operator' */ |
| 16603 | L4_MABX_B.Operator_pw = (uint16_T)(L4_MABX_B.DataTypeConversion1_n3 | |
| 16604 | L4_MABX_B.ShiftArithmetic_j); |
| 16605 | |
| 16606 | /* DataTypeConversion: '<S556>/DataType' */ |
| 16607 | L4_MABX_B.DataType_aw = L4_MABX_B.Operator_pw; |
| 16608 | |
| 16609 | /* DataTypeConversion: '<S531>/Data Type Conversion2' */ |
| 16610 | L4_MABX_B.DataTypeConversion2_b = L4_MABX_B.DataType_aw; |
| 16611 | |
| 16612 | /* Product: '<S531>/Product' incorporates: |
| 16613 | * Constant: '<S531>/Constant' |
| 16614 | */ |
| 16615 | L4_MABX_B.SPN545_EngineGainKpOfTheEndspee = L4_MABX_B.DataTypeConversion2_b * |
| 16616 | L4_MABX_P.Constant_Value_kiz; |
| 16617 | |
| 16618 | /* DataTypeConversion: '<S418>/Data Type Conversion11' */ |
| 16619 | L4_MABX_B.DataTypeConversion11 = L4_MABX_B.SPN545_EngineGainKpOfTheEndspee; |
| 16620 | |
| 16621 | /* DataTypeConversion: '<S534>/Data Type Conversion1' */ |
| 16622 | L4_MABX_B.DataTypeConversion1_fg = L4_MABX_B.DataTypeConversion_go[21]; |
| 16623 | |
| 16624 | /* DataTypeConversion: '<S534>/Data Type Conversion3' */ |
| 16625 | L4_MABX_B.DataTypeConversion3_n = L4_MABX_B.DataTypeConversion_go[22]; |
| 16626 | |
| 16627 | /* ArithShift: '<S534>/Shift Arithmetic' */ |
| 16628 | L4_MABX_B.ShiftArithmetic_o = (uint16_T)(L4_MABX_B.DataTypeConversion3_n << 8); |
| 16629 | |
| 16630 | /* S-Function (sfix_bitop): '<S558>/Operator' */ |
| 16631 | L4_MABX_B.Operator_nb = (uint16_T)(L4_MABX_B.DataTypeConversion1_fg | |
| 16632 | L4_MABX_B.ShiftArithmetic_o); |
| 16633 | |
| 16634 | /* DataTypeConversion: '<S558>/DataType' */ |
| 16635 | L4_MABX_B.DataType_mn = L4_MABX_B.Operator_nb; |
| 16636 | |
| 16637 | /* DataTypeConversion: '<S534>/Data Type Conversion2' */ |
| 16638 | L4_MABX_B.DataTypeConversion2_j = L4_MABX_B.DataType_mn; |
| 16639 | |
| 16640 | /* Product: '<S534>/Product' incorporates: |
| 16641 | * Constant: '<S534>/Constant' |
| 16642 | */ |
| 16643 | L4_MABX_B.SPN533_EngineMaximumMomentaryOv = L4_MABX_B.DataTypeConversion2_j * |
| 16644 | L4_MABX_P.Constant_Value_ea; |
| 16645 | |
| 16646 | /* DataTypeConversion: '<S418>/Data Type Conversion13' */ |
| 16647 | L4_MABX_B.DataTypeConversion13 = L4_MABX_B.SPN533_EngineMaximumMomentaryOv; |
| 16648 | |
| 16649 | /* DataTypeConversion: '<S535>/Data Type Conversion2' */ |
| 16650 | L4_MABX_B.DataTypeConversion2_l = L4_MABX_B.DataTypeConversion_go[23]; |
| 16651 | |
| 16652 | /* Product: '<S535>/Product' incorporates: |
| 16653 | * Constant: '<S535>/Constant' |
| 16654 | */ |
| 16655 | L4_MABX_B.SPN534_EngineMaximumMomentaryOv = L4_MABX_B.DataTypeConversion2_l * |
| 16656 | L4_MABX_P.Constant_Value_jv; |
| 16657 | |
| 16658 | /* DataTypeConversion: '<S418>/Data Type Conversion14' */ |
| 16659 | L4_MABX_B.DataTypeConversion14 = L4_MABX_B.SPN534_EngineMaximumMomentaryOv; |
| 16660 | |
| 16661 | /* DataTypeConversion: '<S536>/Data Type Conversion2' */ |
| 16662 | L4_MABX_B.DataTypeConversion2_n = L4_MABX_B.DataTypeConversion_go[24]; |
| 16663 | |
| 16664 | /* Product: '<S536>/Product' incorporates: |
| 16665 | * Constant: '<S536>/Constant' |
| 16666 | */ |
| 16667 | L4_MABX_B.SPN535_EngineRequestedSpeedCont = L4_MABX_B.DataTypeConversion2_n * |
| 16668 | L4_MABX_P.Constant_Value_io; |
| 16669 | |
| 16670 | /* DataTypeConversion: '<S418>/Data Type Conversion15' */ |
| 16671 | L4_MABX_B.DataTypeConversion15 = L4_MABX_B.SPN535_EngineRequestedSpeedCont; |
| 16672 | |
| 16673 | /* DataTypeConversion: '<S537>/Data Type Conversion2' */ |
| 16674 | L4_MABX_B.DataTypeConversion2_cw = L4_MABX_B.DataTypeConversion_go[25]; |
| 16675 | |
| 16676 | /* Product: '<S537>/Product' incorporates: |
| 16677 | * Constant: '<S537>/Constant' |
| 16678 | */ |
| 16679 | L4_MABX_B.SPN536_EngineRequestedSpeedCont = L4_MABX_B.DataTypeConversion2_cw * |
| 16680 | L4_MABX_P.Constant_Value_b; |
| 16681 | |
| 16682 | /* DataTypeConversion: '<S418>/Data Type Conversion16' */ |
| 16683 | L4_MABX_B.DataTypeConversion16 = L4_MABX_B.SPN536_EngineRequestedSpeedCont; |
| 16684 | |
| 16685 | /* DataTypeConversion: '<S538>/Data Type Conversion' */ |
| 16686 | L4_MABX_B.DataTypeConversion_o = L4_MABX_B.DataTypeConversion_go[26]; |
| 16687 | |
| 16688 | /* Sum: '<S538>/Add' incorporates: |
| 16689 | * Constant: '<S538>/Constant' |
| 16690 | */ |
| 16691 | L4_MABX_B.SPN537_EngineRequestedTorqueCon = L4_MABX_B.DataTypeConversion_o + |
| 16692 | L4_MABX_P.Constant_Value_dk; |
| 16693 | |
| 16694 | /* DataTypeConversion: '<S418>/Data Type Conversion17' */ |
| 16695 | L4_MABX_B.DataTypeConversion17 = L4_MABX_B.SPN537_EngineRequestedTorqueCon; |
| 16696 | |
| 16697 | /* DataTypeConversion: '<S539>/Data Type Conversion' */ |
| 16698 | L4_MABX_B.DataTypeConversion_j = L4_MABX_B.DataTypeConversion_go[27]; |
| 16699 | |
| 16700 | /* Sum: '<S539>/Add' incorporates: |
| 16701 | * Constant: '<S539>/Constant' |
| 16702 | */ |
| 16703 | L4_MABX_B.SPN538_EngineRequestedTorqueCon = L4_MABX_B.DataTypeConversion_j + |
| 16704 | L4_MABX_P.Constant_Value_ga; |
| 16705 | |
| 16706 | /* DataTypeConversion: '<S418>/Data Type Conversion18' */ |
| 16707 | L4_MABX_B.DataTypeConversion18 = L4_MABX_B.SPN538_EngineRequestedTorqueCon; |
| 16708 | |
| 16709 | /* DataTypeConversion: '<S540>/Data Type Conversion1' */ |
| 16710 | L4_MABX_B.DataTypeConversion1_o = L4_MABX_B.DataTypeConversion_go[28]; |
| 16711 | |
| 16712 | /* DataTypeConversion: '<S540>/Data Type Conversion3' */ |
| 16713 | L4_MABX_B.DataTypeConversion3_a = L4_MABX_B.DataTypeConversion_go[29]; |
| 16714 | |
| 16715 | /* ArithShift: '<S540>/Shift Arithmetic' */ |
| 16716 | L4_MABX_B.ShiftArithmetic_h5 = (uint16_T)(L4_MABX_B.DataTypeConversion3_a << 8); |
| 16717 | |
| 16718 | /* S-Function (sfix_bitop): '<S559>/Operator' */ |
| 16719 | L4_MABX_B.Operator_no = (uint16_T)(L4_MABX_B.DataTypeConversion1_o | |
| 16720 | L4_MABX_B.ShiftArithmetic_h5); |
| 16721 | |
| 16722 | /* DataTypeConversion: '<S559>/DataType' */ |
| 16723 | L4_MABX_B.DataType_mo = L4_MABX_B.Operator_no; |
| 16724 | |
| 16725 | /* DataTypeConversion: '<S540>/Data Type Conversion2' */ |
| 16726 | L4_MABX_B.DataTypeConversion2_lm = L4_MABX_B.DataType_mo; |
| 16727 | |
| 16728 | /* Product: '<S540>/Product' incorporates: |
| 16729 | * Constant: '<S540>/Constant' |
| 16730 | */ |
| 16731 | L4_MABX_B.SPN1712_EngRequestedSpeedCtrlRn = L4_MABX_B.DataTypeConversion2_lm * |
| 16732 | L4_MABX_P.Constant_Value_a5; |
| 16733 | |
| 16734 | /* DataTypeConversion: '<S418>/Data Type Conversion19' */ |
| 16735 | L4_MABX_B.DataTypeConversion19 = L4_MABX_B.SPN1712_EngRequestedSpeedCtrlRn; |
| 16736 | |
| 16737 | /* DataTypeConversion: '<S548>/Data Type Conversion' */ |
| 16738 | L4_MABX_B.DataTypeConversion_ee = L4_MABX_B.DataTypeConversion_go[3]; |
| 16739 | |
| 16740 | /* DataTypeConversion: '<S548>/Data Type Conversion1' */ |
| 16741 | L4_MABX_B.DataTypeConversion1_la = L4_MABX_B.DataTypeConversion_go[4]; |
| 16742 | |
| 16743 | /* ArithShift: '<S548>/Shift Arithmetic' */ |
| 16744 | L4_MABX_B.ShiftArithmetic_c = (uint16_T)(L4_MABX_B.DataTypeConversion1_la << 8); |
| 16745 | |
| 16746 | /* S-Function (sfix_bitop): '<S562>/Operator' */ |
| 16747 | L4_MABX_B.Operator_a = (uint16_T)(L4_MABX_B.DataTypeConversion_ee | |
| 16748 | L4_MABX_B.ShiftArithmetic_c); |
| 16749 | |
| 16750 | /* DataTypeConversion: '<S562>/DataType' */ |
| 16751 | L4_MABX_B.DataType_an = L4_MABX_B.Operator_a; |
| 16752 | |
| 16753 | /* DataTypeConversion: '<S548>/Data Type Conversion2' */ |
| 16754 | L4_MABX_B.DataTypeConversion2_lv = L4_MABX_B.DataType_an; |
| 16755 | |
| 16756 | /* Product: '<S548>/Product' incorporates: |
| 16757 | * Constant: '<S548>/Constant' |
| 16758 | */ |
| 16759 | L4_MABX_B.SPN528_EngineSpeedAtPoint2 = L4_MABX_B.DataTypeConversion2_lv * |
| 16760 | L4_MABX_P.Constant_Value_al; |
| 16761 | |
| 16762 | /* DataTypeConversion: '<S418>/Data Type Conversion2' */ |
| 16763 | L4_MABX_B.DataTypeConversion2_la = L4_MABX_B.SPN528_EngineSpeedAtPoint2; |
| 16764 | |
| 16765 | /* DataTypeConversion: '<S541>/Data Type Conversion1' */ |
| 16766 | L4_MABX_B.DataTypeConversion1_ol = L4_MABX_B.DataTypeConversion_go[30]; |
| 16767 | |
| 16768 | /* DataTypeConversion: '<S541>/Data Type Conversion3' */ |
| 16769 | L4_MABX_B.DataTypeConversion3_lm = L4_MABX_B.DataTypeConversion_go[31]; |
| 16770 | |
| 16771 | /* ArithShift: '<S541>/Shift Arithmetic' */ |
| 16772 | L4_MABX_B.ShiftArithmetic_b = (uint16_T)(L4_MABX_B.DataTypeConversion3_lm << 8); |
| 16773 | |
| 16774 | /* S-Function (sfix_bitop): '<S560>/Operator' */ |
| 16775 | L4_MABX_B.Operator_pj = (uint16_T)(L4_MABX_B.DataTypeConversion1_ol | |
| 16776 | L4_MABX_B.ShiftArithmetic_b); |
| 16777 | |
| 16778 | /* DataTypeConversion: '<S560>/DataType' */ |
| 16779 | L4_MABX_B.DataType_f4 = L4_MABX_B.Operator_pj; |
| 16780 | |
| 16781 | /* DataTypeConversion: '<S541>/Data Type Conversion2' */ |
| 16782 | L4_MABX_B.DataTypeConversion2_by = L4_MABX_B.DataType_f4; |
| 16783 | |
| 16784 | /* Product: '<S541>/Product' incorporates: |
| 16785 | * Constant: '<S541>/Constant' |
| 16786 | */ |
| 16787 | L4_MABX_B.SPN1794_EngineMomentOfInertia = L4_MABX_B.DataTypeConversion2_by * |
| 16788 | L4_MABX_P.Constant_Value_fi; |
| 16789 | |
| 16790 | /* DataTypeConversion: '<S418>/Data Type Conversion20' */ |
| 16791 | L4_MABX_B.DataTypeConversion20 = L4_MABX_B.SPN1794_EngineMomentOfInertia; |
| 16792 | |
| 16793 | /* DataTypeConversion: '<S542>/Data Type Conversion' */ |
| 16794 | L4_MABX_B.DataTypeConversion_ks = L4_MABX_B.DataTypeConversion_go[32]; |
| 16795 | |
| 16796 | /* DataTypeConversion: '<S542>/Data Type Conversion1' */ |
| 16797 | L4_MABX_B.DataTypeConversion1_jh = L4_MABX_B.DataTypeConversion_go[33]; |
| 16798 | |
| 16799 | /* ArithShift: '<S542>/Shift Arithmetic' */ |
| 16800 | L4_MABX_B.ShiftArithmetic_cm = (uint16_T)(L4_MABX_B.DataTypeConversion1_jh << |
| 16801 | 8); |
| 16802 | |
| 16803 | /* S-Function (sfix_bitop): '<S561>/Operator' */ |
| 16804 | L4_MABX_B.Operator_g0 = (uint16_T)(L4_MABX_B.DataTypeConversion_ks | |
| 16805 | L4_MABX_B.ShiftArithmetic_cm); |
| 16806 | |
| 16807 | /* DataTypeConversion: '<S561>/DataType' */ |
| 16808 | L4_MABX_B.DataType_ln = L4_MABX_B.Operator_g0; |
| 16809 | |
| 16810 | /* DataTypeConversion: '<S542>/Data Type Conversion2' */ |
| 16811 | L4_MABX_B.SPN1846_EngineDefaultTorqueLimi = L4_MABX_B.DataType_ln; |
| 16812 | |
| 16813 | /* DataTypeConversion: '<S418>/Data Type Conversion21' */ |
| 16814 | L4_MABX_B.DataTypeConversion21 = L4_MABX_B.SPN1846_EngineDefaultTorqueLimi; |
| 16815 | |
| 16816 | /* DataTypeConversion: '<S418>/Data Type Conversion22' */ |
| 16817 | L4_MABX_B.DataTypeConversion22 = L4_MABX_B.DataTypeConversion_go[34]; |
| 16818 | |
| 16819 | /* DataTypeConversion: '<S418>/Data Type Conversion23' */ |
| 16820 | L4_MABX_B.DataTypeConversion23 = L4_MABX_B.DataTypeConversion_go[35]; |
| 16821 | |
| 16822 | /* DataTypeConversion: '<S418>/Data Type Conversion24' */ |
| 16823 | L4_MABX_B.DataTypeConversion24 = L4_MABX_B.DataTypeConversion_go[36]; |
| 16824 | |
| 16825 | /* DataTypeConversion: '<S418>/Data Type Conversion25' */ |
| 16826 | L4_MABX_B.DataTypeConversion25 = L4_MABX_B.DataTypeConversion_go[37]; |
| 16827 | |
| 16828 | /* DataTypeConversion: '<S418>/Data Type Conversion26' */ |
| 16829 | L4_MABX_B.DataTypeConversion26 = L4_MABX_B.DataTypeConversion_go[38]; |
| 16830 | |
| 16831 | /* DataTypeConversion: '<S549>/Data Type Conversion' */ |
| 16832 | L4_MABX_B.DataTypeConversion_p = L4_MABX_B.DataTypeConversion_go[5]; |
| 16833 | |
| 16834 | /* Sum: '<S549>/Add' incorporates: |
| 16835 | * Constant: '<S549>/Constant' |
| 16836 | */ |
| 16837 | L4_MABX_B.SPN540_EnginePercentTorqueAtPoi = L4_MABX_B.DataTypeConversion_p + |
| 16838 | L4_MABX_P.Constant_Value_ir; |
| 16839 | |
| 16840 | /* DataTypeConversion: '<S418>/Data Type Conversion3' */ |
| 16841 | L4_MABX_B.DataTypeConversion3 = L4_MABX_B.SPN540_EnginePercentTorqueAtPoi; |
| 16842 | |
| 16843 | /* DataTypeConversion: '<S550>/Data Type Conversion' */ |
| 16844 | L4_MABX_B.DataTypeConversion_i0 = L4_MABX_B.DataTypeConversion_go[6]; |
| 16845 | |
| 16846 | /* DataTypeConversion: '<S550>/Data Type Conversion1' */ |
| 16847 | L4_MABX_B.DataTypeConversion1_g4 = L4_MABX_B.DataTypeConversion_go[7]; |
| 16848 | |
| 16849 | /* ArithShift: '<S550>/Shift Arithmetic' */ |
| 16850 | L4_MABX_B.ShiftArithmetic_a = (uint16_T)(L4_MABX_B.DataTypeConversion1_g4 << 8); |
| 16851 | |
| 16852 | /* S-Function (sfix_bitop): '<S563>/Operator' */ |
| 16853 | L4_MABX_B.Operator_c = (uint16_T)(L4_MABX_B.DataTypeConversion_i0 | |
| 16854 | L4_MABX_B.ShiftArithmetic_a); |
| 16855 | |
| 16856 | /* DataTypeConversion: '<S563>/DataType' */ |
| 16857 | L4_MABX_B.DataType_kd = L4_MABX_B.Operator_c; |
| 16858 | |
| 16859 | /* DataTypeConversion: '<S550>/Data Type Conversion2' */ |
| 16860 | L4_MABX_B.DataTypeConversion2_m = L4_MABX_B.DataType_kd; |
| 16861 | |
| 16862 | /* Product: '<S550>/Product' incorporates: |
| 16863 | * Constant: '<S550>/Constant' |
| 16864 | */ |
| 16865 | L4_MABX_B.SPN529_EngineSpeedAtPoint3 = L4_MABX_B.DataTypeConversion2_m * |
| 16866 | L4_MABX_P.Constant_Value_m3; |
| 16867 | |
| 16868 | /* DataTypeConversion: '<S418>/Data Type Conversion4' */ |
| 16869 | L4_MABX_B.DataTypeConversion4 = L4_MABX_B.SPN529_EngineSpeedAtPoint3; |
| 16870 | |
| 16871 | /* DataTypeConversion: '<S551>/Data Type Conversion' */ |
| 16872 | L4_MABX_B.DataTypeConversion_ph = L4_MABX_B.DataTypeConversion_go[8]; |
| 16873 | |
| 16874 | /* Sum: '<S551>/Add' incorporates: |
| 16875 | * Constant: '<S551>/Constant' |
| 16876 | */ |
| 16877 | L4_MABX_B.SPN541_EnginePercentTorqueAtPoi = L4_MABX_B.DataTypeConversion_ph + |
| 16878 | L4_MABX_P.Constant_Value_oj; |
| 16879 | |
| 16880 | /* DataTypeConversion: '<S418>/Data Type Conversion5' */ |
| 16881 | L4_MABX_B.DataTypeConversion5 = L4_MABX_B.SPN541_EnginePercentTorqueAtPoi; |
| 16882 | |
| 16883 | /* DataTypeConversion: '<S552>/Data Type Conversion' */ |
| 16884 | L4_MABX_B.DataTypeConversion_gp = L4_MABX_B.DataTypeConversion_go[9]; |
| 16885 | |
| 16886 | /* DataTypeConversion: '<S552>/Data Type Conversion1' */ |
| 16887 | L4_MABX_B.DataTypeConversion1_nr = L4_MABX_B.DataTypeConversion_go[10]; |
| 16888 | |
| 16889 | /* ArithShift: '<S552>/Shift Arithmetic' */ |
| 16890 | L4_MABX_B.ShiftArithmetic_hd = (uint16_T)(L4_MABX_B.DataTypeConversion1_nr << |
| 16891 | 8); |
| 16892 | |
| 16893 | /* S-Function (sfix_bitop): '<S564>/Operator' */ |
| 16894 | L4_MABX_B.Operator_kb = (uint16_T)(L4_MABX_B.DataTypeConversion_gp | |
| 16895 | L4_MABX_B.ShiftArithmetic_hd); |
| 16896 | |
| 16897 | /* DataTypeConversion: '<S564>/DataType' */ |
| 16898 | L4_MABX_B.DataType_jd = L4_MABX_B.Operator_kb; |
| 16899 | |
| 16900 | /* DataTypeConversion: '<S552>/Data Type Conversion2' */ |
| 16901 | L4_MABX_B.DataTypeConversion2_k = L4_MABX_B.DataType_jd; |
| 16902 | |
| 16903 | /* Product: '<S552>/Product' incorporates: |
| 16904 | * Constant: '<S552>/Constant' |
| 16905 | */ |
| 16906 | L4_MABX_B.SPN530_EngineSpeedAtPoint4 = L4_MABX_B.DataTypeConversion2_k * |
| 16907 | L4_MABX_P.Constant_Value_jc; |
| 16908 | |
| 16909 | /* DataTypeConversion: '<S418>/Data Type Conversion6' */ |
| 16910 | L4_MABX_B.DataTypeConversion6 = L4_MABX_B.SPN530_EngineSpeedAtPoint4; |
| 16911 | |
| 16912 | /* DataTypeConversion: '<S527>/Data Type Conversion' */ |
| 16913 | L4_MABX_B.DataTypeConversion_f = L4_MABX_B.DataTypeConversion_go[11]; |
| 16914 | |
| 16915 | /* Sum: '<S527>/Add' incorporates: |
| 16916 | * Constant: '<S527>/Constant' |
| 16917 | */ |
| 16918 | L4_MABX_B.SPN542_EnginePercentTorqueAtPoi = L4_MABX_B.DataTypeConversion_f + |
| 16919 | L4_MABX_P.Constant_Value_ili; |
| 16920 | |
| 16921 | /* DataTypeConversion: '<S418>/Data Type Conversion7' */ |
| 16922 | L4_MABX_B.DataTypeConversion7 = L4_MABX_B.SPN542_EnginePercentTorqueAtPoi; |
| 16923 | |
| 16924 | /* DataTypeConversion: '<S528>/Data Type Conversion' */ |
| 16925 | L4_MABX_B.DataTypeConversion_h = L4_MABX_B.DataTypeConversion_go[12]; |
| 16926 | |
| 16927 | /* DataTypeConversion: '<S528>/Data Type Conversion1' */ |
| 16928 | L4_MABX_B.DataTypeConversion1_gv = L4_MABX_B.DataTypeConversion_go[13]; |
| 16929 | |
| 16930 | /* ArithShift: '<S528>/Shift Arithmetic' */ |
| 16931 | L4_MABX_B.ShiftArithmetic_p = (uint16_T)(L4_MABX_B.DataTypeConversion1_gv << 8); |
| 16932 | |
| 16933 | /* S-Function (sfix_bitop): '<S554>/Operator' */ |
| 16934 | L4_MABX_B.Operator_ay = (uint16_T)(L4_MABX_B.DataTypeConversion_h | |
| 16935 | L4_MABX_B.ShiftArithmetic_p); |
| 16936 | |
| 16937 | /* DataTypeConversion: '<S554>/DataType' */ |
| 16938 | L4_MABX_B.DataType_c = L4_MABX_B.Operator_ay; |
| 16939 | |
| 16940 | /* DataTypeConversion: '<S528>/Data Type Conversion2' */ |
| 16941 | L4_MABX_B.DataTypeConversion2_e = L4_MABX_B.DataType_c; |
| 16942 | |
| 16943 | /* Product: '<S528>/Product' incorporates: |
| 16944 | * Constant: '<S528>/Constant' |
| 16945 | */ |
| 16946 | L4_MABX_B.SPN531_EngineSpeedAtPoint5 = L4_MABX_B.DataTypeConversion2_e * |
| 16947 | L4_MABX_P.Constant_Value_eg; |
| 16948 | |
| 16949 | /* DataTypeConversion: '<S418>/Data Type Conversion8' */ |
| 16950 | L4_MABX_B.DataTypeConversion8 = L4_MABX_B.SPN531_EngineSpeedAtPoint5; |
| 16951 | |
| 16952 | /* DataTypeConversion: '<S529>/Data Type Conversion' */ |
| 16953 | L4_MABX_B.DataTypeConversion_n = L4_MABX_B.DataTypeConversion_go[14]; |
| 16954 | |
| 16955 | /* Sum: '<S529>/Add' incorporates: |
| 16956 | * Constant: '<S529>/Constant' |
| 16957 | */ |
| 16958 | L4_MABX_B.SPN543_EnginePercentTorqueAtPoi = L4_MABX_B.DataTypeConversion_n + |
| 16959 | L4_MABX_P.Constant_Value_ff; |
| 16960 | |
| 16961 | /* DataTypeConversion: '<S418>/Data Type Conversion9' */ |
| 16962 | L4_MABX_B.DataTypeConversion9 = L4_MABX_B.SPN543_EnginePercentTorqueAtPoi; |
| 16963 | |
| 16964 | /* DataTypeConversion: '<S475>/Data Type Conversion8' */ |
| 16965 | L4_MABX_B.RX_status_c = (L4_MABX_B.SFunction1_o9_np != 0.0); |
| 16966 | |
| 16967 | /* MultiPortSwitch: '<S421>/Multiport_Switch' */ |
| 16968 | L4_MABX_B.RX_status_j = L4_MABX_B.RX_status_c; |
| 16969 | |
| 16970 | /* DataTypeConversion: '<S475>/Data Type Conversion9' */ |
| 16971 | L4_MABX_B.RX_time = L4_MABX_B.SFunction1_o10_j1; |
| 16972 | |
| 16973 | /* MultiPortSwitch: '<S421>/Multiport_Switch' */ |
| 16974 | L4_MABX_B.RX_time_o = L4_MABX_B.RX_time; |
| 16975 | |
| 16976 | /* DataTypeConversion: '<S475>/Data Type Conversion10' */ |
| 16977 | L4_MABX_B.RX_delta_time = L4_MABX_B.SFunction1_o11_ja; |
| 16978 | |
| 16979 | /* MultiPortSwitch: '<S421>/Multiport_Switch' */ |
| 16980 | L4_MABX_B.RX_delta_time_p = L4_MABX_B.RX_delta_time; |
| 16981 | |
| 16982 | /* RelationalOperator: '<S479>/Operator' incorporates: |
| 16983 | * Constant: '<S421>/Constant' |
| 16984 | * Constant: '<S476>/Constant1' |
| 16985 | */ |
| 16986 | L4_MABX_B.Operator_m15 = (L4_MABX_P.Constant_Value_nw == |
| 16987 | L4_MABX_P.Constant1_Value_bb); |
| 16988 | |
| 16989 | /* RelationalOperator: '<S480>/Operator' incorporates: |
| 16990 | * Constant: '<S421>/Constant' |
| 16991 | * Constant: '<S476>/Constant2' |
| 16992 | */ |
| 16993 | L4_MABX_B.Operator_fn = (L4_MABX_P.Constant_Value_nw == |
| 16994 | L4_MABX_P.Constant2_Value_e); |
| 16995 | |
| 16996 | /* RelationalOperator: '<S481>/Operator' incorporates: |
| 16997 | * Constant: '<S421>/Constant' |
| 16998 | * Constant: '<S476>/Constant3' |
| 16999 | */ |
| 17000 | L4_MABX_B.Operator_c4 = (L4_MABX_P.Constant_Value_nw == |
| 17001 | L4_MABX_P.Constant3_Value_h); |
| 17002 | |
| 17003 | /* RelationalOperator: '<S482>/Operator' incorporates: |
| 17004 | * Constant: '<S421>/Constant' |
| 17005 | * Constant: '<S476>/Constant4' |
| 17006 | */ |
| 17007 | L4_MABX_B.Operator_keu = (L4_MABX_P.Constant_Value_nw == |
| 17008 | L4_MABX_P.Constant4_Value_p); |
| 17009 | |
| 17010 | /* RelationalOperator: '<S483>/Operator' incorporates: |
| 17011 | * Constant: '<S421>/Constant' |
| 17012 | * Constant: '<S476>/Constant5' |
| 17013 | */ |
| 17014 | L4_MABX_B.Operator_jx = (L4_MABX_P.Constant_Value_nw == |
| 17015 | L4_MABX_P.Constant5_Value_m); |
| 17016 | |
| 17017 | /* DataTypeConversion: '<S484>/Data Type Conversion9' */ |
| 17018 | L4_MABX_B.RX_time_j = L4_MABX_B.SFunction1_o10_iw; |
| 17019 | |
| 17020 | /* MultiPortSwitch: '<S422>/Multiport_Switch' */ |
| 17021 | L4_MABX_B.RX_time_c = L4_MABX_B.RX_time_j; |
| 17022 | |
| 17023 | /* DataTypeConversion: '<S484>/Data Type Conversion10' */ |
| 17024 | L4_MABX_B.RX_delta_time_n = L4_MABX_B.SFunction1_o11_h; |
| 17025 | |
| 17026 | /* MultiPortSwitch: '<S422>/Multiport_Switch' */ |
| 17027 | L4_MABX_B.RX_delta_time_d = L4_MABX_B.RX_delta_time_n; |
| 17028 | |
| 17029 | /* RelationalOperator: '<S488>/Operator' incorporates: |
| 17030 | * Constant: '<S422>/Constant' |
| 17031 | * Constant: '<S485>/Constant1' |
| 17032 | */ |
| 17033 | L4_MABX_B.Operator_dj0 = (L4_MABX_P.Constant_Value_crj == |
| 17034 | L4_MABX_P.Constant1_Value_lw); |
| 17035 | |
| 17036 | /* RelationalOperator: '<S489>/Operator' incorporates: |
| 17037 | * Constant: '<S422>/Constant' |
| 17038 | * Constant: '<S485>/Constant2' |
| 17039 | */ |
| 17040 | L4_MABX_B.Operator_gi = (L4_MABX_P.Constant_Value_crj == |
| 17041 | L4_MABX_P.Constant2_Value_f); |
| 17042 | |
| 17043 | /* RelationalOperator: '<S490>/Operator' incorporates: |
| 17044 | * Constant: '<S422>/Constant' |
| 17045 | * Constant: '<S485>/Constant3' |
| 17046 | */ |
| 17047 | L4_MABX_B.Operator_kz = (L4_MABX_P.Constant_Value_crj == |
| 17048 | L4_MABX_P.Constant3_Value_n2); |
| 17049 | |
| 17050 | /* RelationalOperator: '<S491>/Operator' incorporates: |
| 17051 | * Constant: '<S422>/Constant' |
| 17052 | * Constant: '<S485>/Constant4' |
| 17053 | */ |
| 17054 | L4_MABX_B.Operator_aa = (L4_MABX_P.Constant_Value_crj == |
| 17055 | L4_MABX_P.Constant4_Value_e); |
| 17056 | |
| 17057 | /* RelationalOperator: '<S492>/Operator' incorporates: |
| 17058 | * Constant: '<S422>/Constant' |
| 17059 | * Constant: '<S485>/Constant5' |
| 17060 | */ |
| 17061 | L4_MABX_B.Operator_bly = (L4_MABX_P.Constant_Value_crj == |
| 17062 | L4_MABX_P.Constant5_Value_kw); |
| 17063 | |
| 17064 | /* DataTypeConversion: '<S493>/Data Type Conversion1' */ |
| 17065 | L4_MABX_B.SpeedOfForwardVehicle = L4_MABX_B.SFunction1_o1_da; |
| 17066 | |
| 17067 | /* DataTypeConversion: '<S493>/Data Type Conversion10' */ |
| 17068 | L4_MABX_B.RX_delta_time_de = L4_MABX_B.SFunction1_o13_be; |
| 17069 | |
| 17070 | /* DataTypeConversion: '<S493>/Data Type Conversion11' */ |
| 17071 | L4_MABX_B.ACCSystemShutoffWarning = L4_MABX_B.SFunction1_o8_gf; |
| 17072 | |
| 17073 | /* DataTypeConversion: '<S493>/Data Type Conversion2' */ |
| 17074 | L4_MABX_B.DistanceToForwardVehicle = L4_MABX_B.SFunction1_o2_f0; |
| 17075 | |
| 17076 | /* DataTypeConversion: '<S493>/Data Type Conversion3' */ |
| 17077 | L4_MABX_B.AdaptiveCruiseCtrlSetSpeed = L4_MABX_B.SFunction1_o3_ef; |
| 17078 | |
| 17079 | /* DataTypeConversion: '<S493>/Data Type Conversion4' */ |
| 17080 | L4_MABX_B.AdaptiveCruiseCtrlMode = L4_MABX_B.SFunction1_o4_b32; |
| 17081 | |
| 17082 | /* DataTypeConversion: '<S493>/Data Type Conversion5' */ |
| 17083 | L4_MABX_B.AdptveCruiseCtrlSetDistanceMode = L4_MABX_B.SFunction1_o5_h; |
| 17084 | |
| 17085 | /* DataTypeConversion: '<S493>/Data Type Conversion6' */ |
| 17086 | L4_MABX_B.RoadCurvature = L4_MABX_B.SFunction1_o6_px; |
| 17087 | |
| 17088 | /* DataTypeConversion: '<S493>/Data Type Conversion7' */ |
| 17089 | L4_MABX_B.ACCTargetDetected = L4_MABX_B.SFunction1_o7_h; |
| 17090 | |
| 17091 | /* DataTypeConversion: '<S493>/Data Type Conversion8' */ |
| 17092 | L4_MABX_B.RX_status_d = (L4_MABX_B.SFunction1_o11_gx != 0.0); |
| 17093 | |
| 17094 | /* DataTypeConversion: '<S493>/Data Type Conversion9' */ |
| 17095 | L4_MABX_B.RX_time_h = L4_MABX_B.SFunction1_o12_o; |
| 17096 | |
| 17097 | /* Outputs for Enabled SubSystem: '<S495>/AEBS1_A0' incorporates: |
| 17098 | * EnablePort: '<S496>/Enable' |
| 17099 | */ |
| 17100 | /* Constant: '<S424>/Constant' */ |
| 17101 | if (L4_MABX_P.Constant_Value_g3) { |
| 17102 | /* S-Function (rti_commonblock): '<S496>/S-Function1' */ |
| 17103 | /* This comment workarounds a code generation problem */ |
| 17104 | |
| 17105 | /* dSPACE RTICAN RX Message Block: "AEBS1_A0" Id:217067306 */ |
| 17106 | { |
| 17107 | UInt32 *CAN_Msg; |
| 17108 | static dsfloat time_old = 0.0; |
| 17109 | |
| 17110 | /* Read status and timestamp info (previous message) */ |
| 17111 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02F2A].timestamp != |
| 17112 | time_old) { |
| 17113 | /* ... save timestamp info for the calculation of the RX status |
| 17114 | during the consecutive sample hit*/ |
| 17115 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02F2A]. |
| 17116 | timestamp; |
| 17117 | |
| 17118 | /* ... set the processed flag to one */ |
| 17119 | L4_MABX_B.SFunction1_o6_iu = 1.0; |
| 17120 | L4_MABX_B.SFunction1_o7_m5 = (real_T) |
| 17121 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02F2A].timestamp; |
| 17122 | L4_MABX_B.SFunction1_o8_i = (real_T) |
| 17123 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02F2A].deltatime; |
| 17124 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02F2A].data; |
| 17125 | |
| 17126 | /* Decode CAN message */ |
| 17127 | { |
| 17128 | { |
| 17129 | rtican_Signal_t CAN_Sgn; |
| 17130 | |
| 17131 | /* ...... "AdvEmergencyBrkSysState" (0|4, standard signal, unsigned int, little endian) */ |
| 17132 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 17133 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 17134 | L4_MABX_B.SFunction1_o1_c5 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17135 | |
| 17136 | /* ...... "CollisionWarningLevel" (4|4, standard signal, unsigned int, little endian) */ |
| 17137 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 17138 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 17139 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 17140 | L4_MABX_B.SFunction1_o2_a1 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17141 | |
| 17142 | /* ...... "RelObjctDetForAdvEmergBrakingSys" (8|3, standard signal, unsigned int, little endian) */ |
| 17143 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 17144 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 17145 | L4_MABX_B.SFunction1_o3_mih = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17146 | |
| 17147 | /* ...... "BendOffProbabOfRelevantObject" (12|3, standard signal, unsigned int, little endian) */ |
| 17148 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 17149 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 17150 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 17151 | L4_MABX_B.SFunction1_o4_om = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17152 | |
| 17153 | /* ...... "TimeToCollisionWithRelevantObj" (16|8, standard signal, unsigned int, little endian) */ |
| 17154 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 17155 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17156 | L4_MABX_B.SFunction1_o5_ky = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17157 | } |
| 17158 | } |
| 17159 | } else { |
| 17160 | /* set RX status to 0 because no new message has arrived */ |
| 17161 | L4_MABX_B.SFunction1_o6_iu = 0.0; |
| 17162 | } |
| 17163 | } |
| 17164 | } |
| 17165 | |
| 17166 | /* End of Constant: '<S424>/Constant' */ |
| 17167 | /* End of Outputs for SubSystem: '<S495>/AEBS1_A0' */ |
| 17168 | |
| 17169 | /* DataTypeConversion: '<S495>/Data Type Conversion10' */ |
| 17170 | L4_MABX_B.RX_delta_time_k = L4_MABX_B.SFunction1_o8_i; |
| 17171 | |
| 17172 | /* DataTypeConversion: '<S495>/Data Type Conversion8' */ |
| 17173 | L4_MABX_B.RX_status_l = (L4_MABX_B.SFunction1_o6_iu != 0.0); |
| 17174 | |
| 17175 | /* DataTypeConversion: '<S495>/Data Type Conversion9' */ |
| 17176 | L4_MABX_B.RX_time_p = L4_MABX_B.SFunction1_o7_m5; |
| 17177 | |
| 17178 | /* DataTypeConversion: '<S497>/Data Type Conversion10' */ |
| 17179 | L4_MABX_B.RX_delta_time_b = L4_MABX_B.SFunction1_o11_kj; |
| 17180 | |
| 17181 | /* DataTypeConversion: '<S497>/Data Type Conversion8' */ |
| 17182 | L4_MABX_B.RX_status_b = (L4_MABX_B.SFunction1_o9_af != 0.0); |
| 17183 | |
| 17184 | /* DataTypeConversion: '<S497>/Data Type Conversion9' */ |
| 17185 | L4_MABX_B.RX_time_h3 = L4_MABX_B.SFunction1_o10_j; |
| 17186 | |
| 17187 | /* DataTypeConversion: '<S499>/Data Type Conversion10' */ |
| 17188 | L4_MABX_B.RX_delta_time_l = L4_MABX_B.SFunction1_o8_gn; |
| 17189 | |
| 17190 | /* DataTypeConversion: '<S499>/Data Type Conversion8' */ |
| 17191 | L4_MABX_B.RX_status_f = (L4_MABX_B.SFunction1_o6_ee != 0.0); |
| 17192 | |
| 17193 | /* DataTypeConversion: '<S499>/Data Type Conversion9' */ |
| 17194 | L4_MABX_B.RX_time_n = L4_MABX_B.SFunction1_o7_as; |
| 17195 | |
| 17196 | /* Outputs for Enabled SubSystem: '<S501>/B2' incorporates: |
| 17197 | * EnablePort: '<S502>/Enable' |
| 17198 | */ |
| 17199 | /* Constant: '<S427>/Constant' */ |
| 17200 | if (L4_MABX_P.Constant_Value_ah > 0.0) { |
| 17201 | /* S-Function (rti_commonblock): '<S502>/S-Function1' */ |
| 17202 | /* This comment workarounds a code generation problem */ |
| 17203 | |
| 17204 | /* dSPACE RTICAN RX Message Block: "B2" Id:418451505 */ |
| 17205 | { |
| 17206 | UInt32 *CAN_Msg; |
| 17207 | static dsfloat time_old = 0.0; |
| 17208 | |
| 17209 | /* Read status and timestamp info (previous message) */ |
| 17210 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F11031].timestamp != |
| 17211 | time_old) { |
| 17212 | /* ... save timestamp info for the calculation of the RX status |
| 17213 | during the consecutive sample hit*/ |
| 17214 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F11031]. |
| 17215 | timestamp; |
| 17216 | |
| 17217 | /* ... set the processed flag to one */ |
| 17218 | L4_MABX_B.SFunction1_o3_ji3 = 1.0; |
| 17219 | L4_MABX_B.SFunction1_o4_my = (real_T) |
| 17220 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F11031].timestamp; |
| 17221 | L4_MABX_B.SFunction1_o5_jz = (real_T) |
| 17222 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F11031].deltatime; |
| 17223 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F11031].data; |
| 17224 | |
| 17225 | /* Decode CAN message */ |
| 17226 | { |
| 17227 | { |
| 17228 | rtican_Signal_t CAN_Sgn; |
| 17229 | |
| 17230 | /* ...... "BrakeAppPressDemanded" (0|16, standard signal, unsigned int, little endian) */ |
| 17231 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 17232 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 17233 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17234 | L4_MABX_B.SFunction1_o1_ng = 0.1 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 17235 | |
| 17236 | /* ...... "BrakeSwitch2" (16|2, standard signal, unsigned int, little endian) */ |
| 17237 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 17238 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 17239 | L4_MABX_B.SFunction1_o2_cj = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17240 | } |
| 17241 | } |
| 17242 | } else { |
| 17243 | /* set RX status to 0 because no new message has arrived */ |
| 17244 | L4_MABX_B.SFunction1_o3_ji3 = 0.0; |
| 17245 | } |
| 17246 | } |
| 17247 | } |
| 17248 | |
| 17249 | /* End of Constant: '<S427>/Constant' */ |
| 17250 | /* End of Outputs for SubSystem: '<S501>/B2' */ |
| 17251 | |
| 17252 | /* DataTypeConversion: '<S501>/Data Type Conversion10' */ |
| 17253 | L4_MABX_B.RX_delta_time_e = L4_MABX_B.SFunction1_o5_jz; |
| 17254 | |
| 17255 | /* DataTypeConversion: '<S501>/Data Type Conversion8' */ |
| 17256 | L4_MABX_B.RX_status_g = (L4_MABX_B.SFunction1_o3_ji3 != 0.0); |
| 17257 | |
| 17258 | /* DataTypeConversion: '<S501>/Data Type Conversion9' */ |
| 17259 | L4_MABX_B.RX_time_a = L4_MABX_B.SFunction1_o4_my; |
| 17260 | |
| 17261 | /* Outputs for Enabled SubSystem: '<S503>/Tracks' incorporates: |
| 17262 | * EnablePort: '<S504>/Enable' |
| 17263 | */ |
| 17264 | /* Constant: '<S428>/Constant' */ |
| 17265 | if (L4_MABX_P.Constant_Value_pac) { |
| 17266 | /* S-Function (rti_commonblock): '<S504>/S-Function1' */ |
| 17267 | /* This comment workarounds a code generation problem */ |
| 17268 | |
| 17269 | /* dSPACE RTICAN RX Message Block: "Tracks" Id:1635 */ |
| 17270 | { |
| 17271 | UInt32 *CAN_Msg; |
| 17272 | static dsfloat time_old = 0.0; |
| 17273 | |
| 17274 | /* Read status and timestamp info (previous message) */ |
| 17275 | if (can_type1_M2_C1_STD[CANTP1_M2_C1_RXSRVC_STD_0x663].timestamp != |
| 17276 | time_old) { |
| 17277 | /* ... save timestamp info for the calculation of the RX status |
| 17278 | during the consecutive sample hit*/ |
| 17279 | time_old = can_type1_M2_C1_STD[CANTP1_M2_C1_RXSRVC_STD_0x663].timestamp; |
| 17280 | |
| 17281 | /* ... set the processed flag to one */ |
| 17282 | L4_MABX_B.SFunction1_o72 = 1.0; |
| 17283 | L4_MABX_B.SFunction1_o73 = (real_T) |
| 17284 | can_type1_M2_C1_STD[CANTP1_M2_C1_RXSRVC_STD_0x663].timestamp; |
| 17285 | L4_MABX_B.SFunction1_o74 = (real_T) |
| 17286 | can_type1_M2_C1_STD[CANTP1_M2_C1_RXSRVC_STD_0x663].deltatime; |
| 17287 | CAN_Msg = can_type1_M2_C1_STD[CANTP1_M2_C1_RXSRVC_STD_0x663].data; |
| 17288 | |
| 17289 | /* Decode CAN message */ |
| 17290 | { |
| 17291 | { |
| 17292 | rtican_Signal_t CAN_Sgn; |
| 17293 | UInt32 modeSignal; |
| 17294 | |
| 17295 | /* ...... "track_multiplexor" (56|8, mode signal, unsigned int, motorola back.) */ |
| 17296 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 17297 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17298 | L4_MABX_B.SFunction1_o71 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17299 | modeSignal = (UInt32) L4_MABX_B.SFunction1_o71; |
| 17300 | if (modeSignal == 4) { |
| 17301 | /* ...... "tr0_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17302 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17303 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17304 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17305 | L4_MABX_B.SFunction1_o1_cq = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17306 | } |
| 17307 | |
| 17308 | if (modeSignal == 5) { |
| 17309 | /* ...... "tr0_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17310 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17311 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17312 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17313 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17314 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17315 | } |
| 17316 | |
| 17317 | L4_MABX_B.SFunction1_o2_is = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17318 | ); |
| 17319 | } |
| 17320 | |
| 17321 | if (modeSignal == 12) { |
| 17322 | /* ...... "tr1_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17323 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17324 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17325 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17326 | L4_MABX_B.SFunction1_o3_ee = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17327 | } |
| 17328 | |
| 17329 | if (modeSignal == 13) { |
| 17330 | /* ...... "tr1_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17331 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17332 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17333 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17334 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17335 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17336 | } |
| 17337 | |
| 17338 | L4_MABX_B.SFunction1_o4_dj = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17339 | ); |
| 17340 | } |
| 17341 | |
| 17342 | if (modeSignal == 20) { |
| 17343 | /* ...... "tr2_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17344 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17345 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17346 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17347 | L4_MABX_B.SFunction1_o5_co = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17348 | } |
| 17349 | |
| 17350 | if (modeSignal == 21) { |
| 17351 | /* ...... "tr2_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17352 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17353 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17354 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17355 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17356 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17357 | } |
| 17358 | |
| 17359 | L4_MABX_B.SFunction1_o6_hz = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17360 | ); |
| 17361 | } |
| 17362 | |
| 17363 | if (modeSignal == 28) { |
| 17364 | /* ...... "tr3_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17365 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17366 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17367 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17368 | L4_MABX_B.SFunction1_o7_nm = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17369 | } |
| 17370 | |
| 17371 | if (modeSignal == 29) { |
| 17372 | /* ...... "tr3_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17373 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17374 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17375 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17376 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17377 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17378 | } |
| 17379 | |
| 17380 | L4_MABX_B.SFunction1_o8_f0 = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17381 | ); |
| 17382 | } |
| 17383 | |
| 17384 | if (modeSignal == 36) { |
| 17385 | /* ...... "tr4_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17386 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17387 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17388 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17389 | L4_MABX_B.SFunction1_o9_ct = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17390 | } |
| 17391 | |
| 17392 | if (modeSignal == 37) { |
| 17393 | /* ...... "tr4_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17394 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17395 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17396 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17397 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17398 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17399 | } |
| 17400 | |
| 17401 | L4_MABX_B.SFunction1_o10_c3 = 0.001 * ( ((real_T) |
| 17402 | CAN_Sgn.SignedSgn) ); |
| 17403 | } |
| 17404 | |
| 17405 | if (modeSignal == 44) { |
| 17406 | /* ...... "tr5_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17407 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17408 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17409 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17410 | L4_MABX_B.SFunction1_o11_n = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17411 | } |
| 17412 | |
| 17413 | if (modeSignal == 45) { |
| 17414 | /* ...... "tr5_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17415 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17416 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17417 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17418 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17419 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17420 | } |
| 17421 | |
| 17422 | L4_MABX_B.SFunction1_o12_a = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17423 | ); |
| 17424 | } |
| 17425 | |
| 17426 | if (modeSignal == 52) { |
| 17427 | /* ...... "tr6_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17428 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17429 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17430 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17431 | L4_MABX_B.SFunction1_o13_f = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17432 | } |
| 17433 | |
| 17434 | if (modeSignal == 53) { |
| 17435 | /* ...... "tr6_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17436 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17437 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17438 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17439 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17440 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17441 | } |
| 17442 | |
| 17443 | L4_MABX_B.SFunction1_o14_p = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17444 | ); |
| 17445 | } |
| 17446 | |
| 17447 | if (modeSignal == 60) { |
| 17448 | /* ...... "tr7_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17449 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17450 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17451 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17452 | L4_MABX_B.SFunction1_o15_k = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17453 | } |
| 17454 | |
| 17455 | if (modeSignal == 61) { |
| 17456 | /* ...... "tr7_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17457 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17458 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17459 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17460 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17461 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17462 | } |
| 17463 | |
| 17464 | L4_MABX_B.SFunction1_o16_b = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17465 | ); |
| 17466 | } |
| 17467 | |
| 17468 | if (modeSignal == 68) { |
| 17469 | /* ...... "tr8_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17470 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17471 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17472 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17473 | L4_MABX_B.SFunction1_o17_p = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17474 | } |
| 17475 | |
| 17476 | if (modeSignal == 69) { |
| 17477 | /* ...... "tr8_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17478 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17479 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17480 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17481 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17482 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17483 | } |
| 17484 | |
| 17485 | L4_MABX_B.SFunction1_o18_b = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17486 | ); |
| 17487 | } |
| 17488 | |
| 17489 | if (modeSignal == 76) { |
| 17490 | /* ...... "tr9_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */ |
| 17491 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17492 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17493 | CAN_Sgn.UnsignedSgn &= 0x00001FFF; |
| 17494 | L4_MABX_B.SFunction1_o19_h = ((real_T) CAN_Sgn.UnsignedSgn); |
| 17495 | } |
| 17496 | |
| 17497 | if (modeSignal == 77) { |
| 17498 | /* ...... "tr9_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */ |
| 17499 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 17500 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6]; |
| 17501 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 17502 | if (CAN_Sgn.SignedSgn >> 15) { |
| 17503 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 17504 | } |
| 17505 | |
| 17506 | L4_MABX_B.SFunction1_o20_h = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17507 | ); |
| 17508 | } |
| 17509 | |
| 17510 | if (modeSignal == 6) { |
| 17511 | /* ...... "tr0_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17512 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17513 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17514 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17515 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17516 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17517 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17518 | } |
| 17519 | |
| 17520 | L4_MABX_B.SFunction1_o21_n = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17521 | } |
| 17522 | |
| 17523 | if (modeSignal == 14) { |
| 17524 | /* ...... "tr1_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17525 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17526 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17527 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17528 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17529 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17530 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17531 | } |
| 17532 | |
| 17533 | L4_MABX_B.SFunction1_o22_ky = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) |
| 17534 | ); |
| 17535 | } |
| 17536 | |
| 17537 | if (modeSignal == 22) { |
| 17538 | /* ...... "tr2_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17539 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17540 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17541 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17542 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17543 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17544 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17545 | } |
| 17546 | |
| 17547 | L4_MABX_B.SFunction1_o23_i = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17548 | } |
| 17549 | |
| 17550 | if (modeSignal == 30) { |
| 17551 | /* ...... "tr3_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17552 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17553 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17554 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17555 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17556 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17557 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17558 | } |
| 17559 | |
| 17560 | L4_MABX_B.SFunction1_o24_h = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17561 | } |
| 17562 | |
| 17563 | if (modeSignal == 38) { |
| 17564 | /* ...... "tr4_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17565 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17566 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17567 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17568 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17569 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17570 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17571 | } |
| 17572 | |
| 17573 | L4_MABX_B.SFunction1_o25_j = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17574 | } |
| 17575 | |
| 17576 | if (modeSignal == 46) { |
| 17577 | /* ...... "tr5_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17578 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17579 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17580 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17581 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17582 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17583 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17584 | } |
| 17585 | |
| 17586 | L4_MABX_B.SFunction1_o26_d = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17587 | } |
| 17588 | |
| 17589 | if (modeSignal == 54) { |
| 17590 | /* ...... "tr6_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17591 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17592 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17593 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17594 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17595 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17596 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17597 | } |
| 17598 | |
| 17599 | L4_MABX_B.SFunction1_o27_c = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17600 | } |
| 17601 | |
| 17602 | if (modeSignal == 62) { |
| 17603 | /* ...... "tr7_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17604 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17605 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17606 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17607 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17608 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17609 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17610 | } |
| 17611 | |
| 17612 | L4_MABX_B.SFunction1_o28_o = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17613 | } |
| 17614 | |
| 17615 | if (modeSignal == 70) { |
| 17616 | /* ...... "tr8_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17617 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17618 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17619 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17620 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17621 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17622 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17623 | } |
| 17624 | |
| 17625 | L4_MABX_B.SFunction1_o29 = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17626 | } |
| 17627 | |
| 17628 | if (modeSignal == 78) { |
| 17629 | /* ...... "tr9_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */ |
| 17630 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 17631 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 17632 | CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6; |
| 17633 | CAN_Sgn.SignedSgn &= 0x000003FF; |
| 17634 | if (CAN_Sgn.SignedSgn >> 9) { |
| 17635 | CAN_Sgn.SignedSgn |= 0xFFFFFC00; |
| 17636 | } |
| 17637 | |
| 17638 | L4_MABX_B.SFunction1_o30 = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17639 | } |
| 17640 | |
| 17641 | if (modeSignal == 4) { |
| 17642 | /* ...... "tr0_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 17643 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 17644 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 17645 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17646 | L4_MABX_B.SFunction1_o31 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 17647 | ); |
| 17648 | } |
| 17649 | |
| 17650 | if (modeSignal == 12) { |
| 17651 | /* ...... "tr1_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 17652 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 17653 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 17654 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17655 | L4_MABX_B.SFunction1_o32 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 17656 | ); |
| 17657 | } |
| 17658 | |
| 17659 | if (modeSignal == 20) { |
| 17660 | /* ...... "tr2_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 17661 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 17662 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 17663 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17664 | L4_MABX_B.SFunction1_o33 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 17665 | ); |
| 17666 | } |
| 17667 | |
| 17668 | if (modeSignal == 28) { |
| 17669 | /* ...... "tr3_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 17670 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 17671 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 17672 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17673 | L4_MABX_B.SFunction1_o34 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 17674 | ); |
| 17675 | } |
| 17676 | |
| 17677 | if (modeSignal == 36) { |
| 17678 | /* ...... "tr4_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 17679 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 17680 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 17681 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17682 | L4_MABX_B.SFunction1_o35 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 17683 | ); |
| 17684 | } |
| 17685 | |
| 17686 | if (modeSignal == 44) { |
| 17687 | /* ...... "tr5_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 17688 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 17689 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 17690 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17691 | L4_MABX_B.SFunction1_o36 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 17692 | ); |
| 17693 | } |
| 17694 | |
| 17695 | if (modeSignal == 52) { |
| 17696 | /* ...... "tr6_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 17697 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 17698 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 17699 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17700 | L4_MABX_B.SFunction1_o37 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 17701 | ); |
| 17702 | } |
| 17703 | |
| 17704 | if (modeSignal == 60) { |
| 17705 | /* ...... "tr7_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 17706 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 17707 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 17708 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17709 | L4_MABX_B.SFunction1_o38 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 17710 | ); |
| 17711 | } |
| 17712 | |
| 17713 | if (modeSignal == 68) { |
| 17714 | /* ...... "tr8_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 17715 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 17716 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 17717 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17718 | L4_MABX_B.SFunction1_o39 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 17719 | ); |
| 17720 | } |
| 17721 | |
| 17722 | if (modeSignal == 76) { |
| 17723 | /* ...... "tr9_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */ |
| 17724 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 17725 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 17726 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 17727 | L4_MABX_B.SFunction1_o40 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 17728 | ); |
| 17729 | } |
| 17730 | |
| 17731 | if (modeSignal == 6) { |
| 17732 | /* ...... "tr0_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17733 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 17734 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17735 | L4_MABX_B.SFunction1_o41 = 0.00392156862745098 * ( ((real_T) |
| 17736 | CAN_Sgn.UnsignedSgn) ); |
| 17737 | } |
| 17738 | |
| 17739 | if (modeSignal == 14) { |
| 17740 | /* ...... "tr1_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17741 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 17742 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17743 | L4_MABX_B.SFunction1_o42 = 0.00392156862745098 * ( ((real_T) |
| 17744 | CAN_Sgn.UnsignedSgn) ); |
| 17745 | } |
| 17746 | |
| 17747 | if (modeSignal == 22) { |
| 17748 | /* ...... "tr2_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17749 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 17750 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17751 | L4_MABX_B.SFunction1_o43 = 0.00392156862745098 * ( ((real_T) |
| 17752 | CAN_Sgn.UnsignedSgn) ); |
| 17753 | } |
| 17754 | |
| 17755 | if (modeSignal == 30) { |
| 17756 | /* ...... "tr3_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17757 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 17758 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17759 | L4_MABX_B.SFunction1_o44 = 0.00392156862745098 * ( ((real_T) |
| 17760 | CAN_Sgn.UnsignedSgn) ); |
| 17761 | } |
| 17762 | |
| 17763 | if (modeSignal == 38) { |
| 17764 | /* ...... "tr4_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17765 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 17766 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17767 | L4_MABX_B.SFunction1_o45 = 0.00392156862745098 * ( ((real_T) |
| 17768 | CAN_Sgn.UnsignedSgn) ); |
| 17769 | } |
| 17770 | |
| 17771 | if (modeSignal == 46) { |
| 17772 | /* ...... "tr5_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17773 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 17774 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17775 | L4_MABX_B.SFunction1_o46 = 0.00392156862745098 * ( ((real_T) |
| 17776 | CAN_Sgn.UnsignedSgn) ); |
| 17777 | } |
| 17778 | |
| 17779 | if (modeSignal == 54) { |
| 17780 | /* ...... "tr6_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17781 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 17782 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17783 | L4_MABX_B.SFunction1_o47 = 0.00392156862745098 * ( ((real_T) |
| 17784 | CAN_Sgn.UnsignedSgn) ); |
| 17785 | } |
| 17786 | |
| 17787 | if (modeSignal == 62) { |
| 17788 | /* ...... "tr7_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17789 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 17790 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17791 | L4_MABX_B.SFunction1_o48 = 0.00392156862745098 * ( ((real_T) |
| 17792 | CAN_Sgn.UnsignedSgn) ); |
| 17793 | } |
| 17794 | |
| 17795 | if (modeSignal == 70) { |
| 17796 | /* ...... "tr8_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17797 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 17798 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17799 | L4_MABX_B.SFunction1_o49 = 0.00392156862745098 * ( ((real_T) |
| 17800 | CAN_Sgn.UnsignedSgn) ); |
| 17801 | } |
| 17802 | |
| 17803 | if (modeSignal == 78) { |
| 17804 | /* ...... "tr9_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17805 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 17806 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17807 | L4_MABX_B.SFunction1_o50 = 0.00392156862745098 * ( ((real_T) |
| 17808 | CAN_Sgn.UnsignedSgn) ); |
| 17809 | } |
| 17810 | |
| 17811 | if (modeSignal == 4) { |
| 17812 | /* ...... "tr0_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 17813 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17814 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 17815 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 17816 | if (CAN_Sgn.SignedSgn >> 13) { |
| 17817 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 17818 | } |
| 17819 | |
| 17820 | L4_MABX_B.SFunction1_o51 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17821 | } |
| 17822 | |
| 17823 | if (modeSignal == 5) { |
| 17824 | /* ...... "tr0_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17825 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17826 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17827 | L4_MABX_B.SFunction1_o52 = -8.8 + ( 0.05 * ( ((real_T) |
| 17828 | CAN_Sgn.UnsignedSgn) ) ); |
| 17829 | } |
| 17830 | |
| 17831 | if (modeSignal == 12) { |
| 17832 | /* ...... "tr1_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 17833 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17834 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 17835 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 17836 | if (CAN_Sgn.SignedSgn >> 13) { |
| 17837 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 17838 | } |
| 17839 | |
| 17840 | L4_MABX_B.SFunction1_o53 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17841 | } |
| 17842 | |
| 17843 | if (modeSignal == 13) { |
| 17844 | /* ...... "tr1_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17845 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17846 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17847 | L4_MABX_B.SFunction1_o54 = -8.8 + ( 0.05 * ( ((real_T) |
| 17848 | CAN_Sgn.UnsignedSgn) ) ); |
| 17849 | } |
| 17850 | |
| 17851 | if (modeSignal == 20) { |
| 17852 | /* ...... "tr2_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 17853 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17854 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 17855 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 17856 | if (CAN_Sgn.SignedSgn >> 13) { |
| 17857 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 17858 | } |
| 17859 | |
| 17860 | L4_MABX_B.SFunction1_o55 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17861 | } |
| 17862 | |
| 17863 | if (modeSignal == 21) { |
| 17864 | /* ...... "tr2_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17865 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17866 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17867 | L4_MABX_B.SFunction1_o56 = -8.8 + ( 0.05 * ( ((real_T) |
| 17868 | CAN_Sgn.UnsignedSgn) ) ); |
| 17869 | } |
| 17870 | |
| 17871 | if (modeSignal == 28) { |
| 17872 | /* ...... "tr3_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 17873 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17874 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 17875 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 17876 | if (CAN_Sgn.SignedSgn >> 13) { |
| 17877 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 17878 | } |
| 17879 | |
| 17880 | L4_MABX_B.SFunction1_o57 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17881 | } |
| 17882 | |
| 17883 | if (modeSignal == 29) { |
| 17884 | /* ...... "tr3_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17885 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17886 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17887 | L4_MABX_B.SFunction1_o58 = -8.8 + ( 0.05 * ( ((real_T) |
| 17888 | CAN_Sgn.UnsignedSgn) ) ); |
| 17889 | } |
| 17890 | |
| 17891 | if (modeSignal == 36) { |
| 17892 | /* ...... "tr4_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 17893 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17894 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 17895 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 17896 | if (CAN_Sgn.SignedSgn >> 13) { |
| 17897 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 17898 | } |
| 17899 | |
| 17900 | L4_MABX_B.SFunction1_o59 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17901 | } |
| 17902 | |
| 17903 | if (modeSignal == 37) { |
| 17904 | /* ...... "tr4_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17905 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17906 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17907 | L4_MABX_B.SFunction1_o60 = -8.8 + ( 0.05 * ( ((real_T) |
| 17908 | CAN_Sgn.UnsignedSgn) ) ); |
| 17909 | } |
| 17910 | |
| 17911 | if (modeSignal == 44) { |
| 17912 | /* ...... "tr5_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 17913 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17914 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 17915 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 17916 | if (CAN_Sgn.SignedSgn >> 13) { |
| 17917 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 17918 | } |
| 17919 | |
| 17920 | L4_MABX_B.SFunction1_o61 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17921 | } |
| 17922 | |
| 17923 | if (modeSignal == 45) { |
| 17924 | /* ...... "tr5_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17925 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17926 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17927 | L4_MABX_B.SFunction1_o62 = -8.8 + ( 0.05 * ( ((real_T) |
| 17928 | CAN_Sgn.UnsignedSgn) ) ); |
| 17929 | } |
| 17930 | |
| 17931 | if (modeSignal == 52) { |
| 17932 | /* ...... "tr6_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 17933 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17934 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 17935 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 17936 | if (CAN_Sgn.SignedSgn >> 13) { |
| 17937 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 17938 | } |
| 17939 | |
| 17940 | L4_MABX_B.SFunction1_o63 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17941 | } |
| 17942 | |
| 17943 | if (modeSignal == 53) { |
| 17944 | /* ...... "tr6_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17945 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17946 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17947 | L4_MABX_B.SFunction1_o64 = -8.8 + ( 0.05 * ( ((real_T) |
| 17948 | CAN_Sgn.UnsignedSgn) ) ); |
| 17949 | } |
| 17950 | |
| 17951 | if (modeSignal == 60) { |
| 17952 | /* ...... "tr7_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 17953 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17954 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 17955 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 17956 | if (CAN_Sgn.SignedSgn >> 13) { |
| 17957 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 17958 | } |
| 17959 | |
| 17960 | L4_MABX_B.SFunction1_o65 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17961 | } |
| 17962 | |
| 17963 | if (modeSignal == 61) { |
| 17964 | /* ...... "tr7_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17965 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17966 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17967 | L4_MABX_B.SFunction1_o66 = -8.8 + ( 0.05 * ( ((real_T) |
| 17968 | CAN_Sgn.UnsignedSgn) ) ); |
| 17969 | } |
| 17970 | |
| 17971 | if (modeSignal == 68) { |
| 17972 | /* ...... "tr8_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 17973 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17974 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 17975 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 17976 | if (CAN_Sgn.SignedSgn >> 13) { |
| 17977 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 17978 | } |
| 17979 | |
| 17980 | L4_MABX_B.SFunction1_o67 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 17981 | } |
| 17982 | |
| 17983 | if (modeSignal == 69) { |
| 17984 | /* ...... "tr8_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 17985 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17986 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 17987 | L4_MABX_B.SFunction1_o68 = -8.8 + ( 0.05 * ( ((real_T) |
| 17988 | CAN_Sgn.UnsignedSgn) ) ); |
| 17989 | } |
| 17990 | |
| 17991 | if (modeSignal == 76) { |
| 17992 | /* ...... "tr9_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */ |
| 17993 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 17994 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2]; |
| 17995 | CAN_Sgn.SignedSgn &= 0x00003FFF; |
| 17996 | if (CAN_Sgn.SignedSgn >> 13) { |
| 17997 | CAN_Sgn.SignedSgn |= 0xFFFFC000; |
| 17998 | } |
| 17999 | |
| 18000 | L4_MABX_B.SFunction1_o69 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 18001 | } |
| 18002 | |
| 18003 | if (modeSignal == 77) { |
| 18004 | /* ...... "tr9_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */ |
| 18005 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18006 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18007 | L4_MABX_B.SFunction1_o70 = -8.8 + ( 0.05 * ( ((real_T) |
| 18008 | CAN_Sgn.UnsignedSgn) ) ); |
| 18009 | } |
| 18010 | } |
| 18011 | } |
| 18012 | } else { |
| 18013 | /* set RX status to 0 because no new message has arrived */ |
| 18014 | L4_MABX_B.SFunction1_o72 = 0.0; |
| 18015 | } |
| 18016 | } |
| 18017 | } |
| 18018 | |
| 18019 | /* End of Constant: '<S428>/Constant' */ |
| 18020 | /* End of Outputs for SubSystem: '<S503>/Tracks' */ |
| 18021 | |
| 18022 | /* DataTypeConversion: '<S503>/Data Type Conversion10' */ |
| 18023 | L4_MABX_B.Bendix_RADAR_Tracks_RX_delta_ti = L4_MABX_B.SFunction1_o74; |
| 18024 | |
| 18025 | /* DataTypeConversion: '<S503>/Data Type Conversion8' */ |
| 18026 | L4_MABX_B.Bendix_RADAR_Tracks_RX_status = (L4_MABX_B.SFunction1_o72 != 0.0); |
| 18027 | |
| 18028 | /* DataTypeConversion: '<S503>/Data Type Conversion9' */ |
| 18029 | L4_MABX_B.Bendix_RADAR_Tracks_RX_time = L4_MABX_B.SFunction1_o73; |
| 18030 | |
| 18031 | /* DataTypeConversion: '<S505>/Data Type Conversion10' */ |
| 18032 | L4_MABX_B.RX_delta_time_g = L4_MABX_B.SFunction1_o23_n; |
| 18033 | |
| 18034 | /* DataTypeConversion: '<S505>/Data Type Conversion8' */ |
| 18035 | L4_MABX_B.RX_status_jw = (L4_MABX_B.SFunction1_o21_mw != 0.0); |
| 18036 | |
| 18037 | /* DataTypeConversion: '<S505>/Data Type Conversion9' */ |
| 18038 | L4_MABX_B.RX_time_e = L4_MABX_B.SFunction1_o22_ft; |
| 18039 | |
| 18040 | /* DataTypeConversion: '<S507>/Data Type Conversion10' */ |
| 18041 | L4_MABX_B.RX_delta_time_da = L4_MABX_B.SFunction1_o23_l; |
| 18042 | |
| 18043 | /* DataTypeConversion: '<S507>/Data Type Conversion8' */ |
| 18044 | L4_MABX_B.RX_status_dg = (L4_MABX_B.SFunction1_o21_h != 0.0); |
| 18045 | |
| 18046 | /* DataTypeConversion: '<S507>/Data Type Conversion9' */ |
| 18047 | L4_MABX_B.RX_time_m = L4_MABX_B.SFunction1_o22_f; |
| 18048 | |
| 18049 | /* Switch: '<S509>/Switch' */ |
| 18050 | if (L4_MABX_B.RX_status_o) { |
| 18051 | L4_MABX_B.RX_status_og = L4_MABX_B.RX_status_o; |
| 18052 | } else { |
| 18053 | /* DataTypeConversion: '<S509>/Data Type Conversion1' */ |
| 18054 | L4_MABX_B.RX_status_hs = (L4_MABX_B.SFunction1_o5_fh != 0.0); |
| 18055 | L4_MABX_B.RX_status_og = L4_MABX_B.RX_status_hs; |
| 18056 | } |
| 18057 | |
| 18058 | if (L4_MABX_B.RX_status_o) { |
| 18059 | /* DataTypeConversion: '<S509>/Data Type Conversion9' */ |
| 18060 | L4_MABX_B.RX_time_nw = L4_MABX_B.SFunction1_o6_db; |
| 18061 | L4_MABX_B.RX_time_er = L4_MABX_B.RX_time_nw; |
| 18062 | |
| 18063 | /* DataTypeConversion: '<S509>/Data Type Conversion10' */ |
| 18064 | L4_MABX_B.RX_delta_time_lz = L4_MABX_B.SFunction1_o7_ln; |
| 18065 | L4_MABX_B.RX_delta_time_j = L4_MABX_B.RX_delta_time_lz; |
| 18066 | } else { |
| 18067 | /* DataTypeConversion: '<S509>/Data Type Conversion2' */ |
| 18068 | L4_MABX_B.RX_time_ni = L4_MABX_B.SFunction1_o6_e5; |
| 18069 | L4_MABX_B.RX_time_er = L4_MABX_B.RX_time_ni; |
| 18070 | |
| 18071 | /* DataTypeConversion: '<S509>/Data Type Conversion3' */ |
| 18072 | L4_MABX_B.RX_delta_time_l1 = L4_MABX_B.SFunction1_o7_a4; |
| 18073 | L4_MABX_B.RX_delta_time_j = L4_MABX_B.RX_delta_time_l1; |
| 18074 | } |
| 18075 | |
| 18076 | /* DataTypeConversion: '<S512>/Data Type Conversion10' */ |
| 18077 | L4_MABX_B.RX_delta_time_a = L4_MABX_B.SFunction1_o4_fk; |
| 18078 | |
| 18079 | /* DataTypeConversion: '<S512>/Data Type Conversion8' */ |
| 18080 | L4_MABX_B.RX_status_k = (L4_MABX_B.SFunction1_o2_ln != 0.0); |
| 18081 | |
| 18082 | /* DataTypeConversion: '<S512>/Data Type Conversion9' */ |
| 18083 | L4_MABX_B.RX_time_e1 = L4_MABX_B.SFunction1_o3_ji; |
| 18084 | |
| 18085 | /* Outputs for Enabled SubSystem: '<S514>/EBC1_0B' incorporates: |
| 18086 | * EnablePort: '<S515>/Enable' |
| 18087 | */ |
| 18088 | /* Constant: '<S433>/Constant1' */ |
| 18089 | if (L4_MABX_P.Constant1_Value_b0) { |
| 18090 | /* S-Function (rti_commonblock): '<S515>/S-Function1' */ |
| 18091 | /* This comment workarounds a code generation problem */ |
| 18092 | |
| 18093 | /* dSPACE RTICAN RX Message Block: "EBC1_0B" Id:418382091 */ |
| 18094 | { |
| 18095 | UInt32 *CAN_Msg; |
| 18096 | static dsfloat time_old = 0.0; |
| 18097 | |
| 18098 | /* Read status and timestamp info (previous message) */ |
| 18099 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0010B].timestamp != |
| 18100 | time_old) { |
| 18101 | /* ... save timestamp info for the calculation of the RX status |
| 18102 | during the consecutive sample hit*/ |
| 18103 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0010B]. |
| 18104 | timestamp; |
| 18105 | |
| 18106 | /* ... set the processed flag to one */ |
| 18107 | L4_MABX_B.SFunction1_o23_o = 1.0; |
| 18108 | L4_MABX_B.SFunction1_o24_o = (real_T) |
| 18109 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0010B].timestamp; |
| 18110 | L4_MABX_B.SFunction1_o25_o = (real_T) |
| 18111 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0010B].deltatime; |
| 18112 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0010B].data; |
| 18113 | |
| 18114 | /* Decode CAN message */ |
| 18115 | { |
| 18116 | { |
| 18117 | rtican_Signal_t CAN_Sgn; |
| 18118 | |
| 18119 | /* ...... "ASREngCtrlActive" (0|2, standard signal, unsigned int, little endian) */ |
| 18120 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18121 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18122 | L4_MABX_B.SFunction1_o1_efr = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18123 | |
| 18124 | /* ...... "ASRBrakeCtrlActive" (2|2, standard signal, unsigned int, little endian) */ |
| 18125 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18126 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18127 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18128 | L4_MABX_B.SFunction1_o2_oh = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18129 | |
| 18130 | /* ...... "AntiLockBrakingActive" (4|2, standard signal, unsigned int, little endian) */ |
| 18131 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18132 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 18133 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18134 | L4_MABX_B.SFunction1_o3_pjc = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18135 | |
| 18136 | /* ...... "EBSBrakeSwitch" (6|2, standard signal, unsigned int, little endian) */ |
| 18137 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18138 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 18139 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18140 | L4_MABX_B.SFunction1_o4_d4 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18141 | |
| 18142 | /* ...... "BrakePedalPos" (8|8, standard signal, unsigned int, little endian) */ |
| 18143 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 18144 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18145 | L4_MABX_B.SFunction1_o5_ga = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 18146 | |
| 18147 | /* ...... "ABSOffroadSwitch" (16|2, standard signal, unsigned int, little endian) */ |
| 18148 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 18149 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18150 | L4_MABX_B.SFunction1_o6_dt = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18151 | |
| 18152 | /* ...... "ASROffroadSwitch" (18|2, standard signal, unsigned int, little endian) */ |
| 18153 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 18154 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18155 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18156 | L4_MABX_B.SFunction1_o7_d4 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18157 | |
| 18158 | /* ...... "ASRHillHolderSwitch" (20|2, standard signal, unsigned int, little endian) */ |
| 18159 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 18160 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 18161 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18162 | L4_MABX_B.SFunction1_o8_f = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18163 | |
| 18164 | /* ...... "TractionCtrlOverrideSwitch" (22|2, standard signal, unsigned int, little endian) */ |
| 18165 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 18166 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 18167 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18168 | L4_MABX_B.SFunction1_o9_bc = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18169 | |
| 18170 | /* ...... "AccelInterlockSwitch" (24|2, standard signal, unsigned int, little endian) */ |
| 18171 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18172 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18173 | L4_MABX_B.SFunction1_o10_h = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18174 | |
| 18175 | /* ...... "EngDerateSwitch" (26|2, standard signal, unsigned int, little endian) */ |
| 18176 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18177 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18178 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18179 | L4_MABX_B.SFunction1_o11_kf = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18180 | |
| 18181 | /* ...... "EngAuxShutdownSwitch" (28|2, standard signal, unsigned int, little endian) */ |
| 18182 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18183 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 18184 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18185 | L4_MABX_B.SFunction1_o12_p = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18186 | |
| 18187 | /* ...... "RemoteAccelEnableSwitch" (30|2, standard signal, unsigned int, little endian) */ |
| 18188 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18189 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 18190 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18191 | L4_MABX_B.SFunction1_o13_h = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18192 | |
| 18193 | /* ...... "EngRetarderSelection" (32|8, standard signal, unsigned int, little endian) */ |
| 18194 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 18195 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18196 | L4_MABX_B.SFunction1_o14_d = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 18197 | |
| 18198 | /* ...... "ABSFullyOperational" (40|2, standard signal, unsigned int, little endian) */ |
| 18199 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18200 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18201 | L4_MABX_B.SFunction1_o15_b = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18202 | |
| 18203 | /* ...... "EBSRedWarningSignal" (42|2, standard signal, unsigned int, little endian) */ |
| 18204 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18205 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18206 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18207 | L4_MABX_B.SFunction1_o16_p = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18208 | |
| 18209 | /* ...... "ABS_EBSAmberWarningSignal" (44|2, standard signal, unsigned int, little endian) */ |
| 18210 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18211 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 18212 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18213 | L4_MABX_B.SFunction1_o17_o = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18214 | |
| 18215 | /* ...... "ATC_ASRInformationSignal" (46|2, standard signal, unsigned int, little endian) */ |
| 18216 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18217 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 18218 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18219 | L4_MABX_B.SFunction1_o18_n = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18220 | |
| 18221 | /* ...... "SrcAddrssOfCtrllngDvcFrBrkCntrl" (48|8, standard signal, unsigned int, little endian) */ |
| 18222 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 18223 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18224 | L4_MABX_B.SFunction1_o19_l = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18225 | |
| 18226 | /* ...... "HaltBrakeSwitch" (58|2, standard signal, unsigned int, little endian) */ |
| 18227 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 18228 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18229 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18230 | L4_MABX_B.SFunction1_o20_a = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18231 | |
| 18232 | /* ...... "TrailerABSStatus" (60|2, standard signal, unsigned int, little endian) */ |
| 18233 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 18234 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 18235 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18236 | L4_MABX_B.SFunction1_o21_m = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18237 | |
| 18238 | /* ...... "TrctrMntdTrilerABSWarningSignal" (62|2, standard signal, unsigned int, little endian) */ |
| 18239 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 18240 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 18241 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18242 | L4_MABX_B.SFunction1_o22_a = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18243 | } |
| 18244 | } |
| 18245 | } else { |
| 18246 | /* set RX status to 0 because no new message has arrived */ |
| 18247 | L4_MABX_B.SFunction1_o23_o = 0.0; |
| 18248 | } |
| 18249 | } |
| 18250 | } |
| 18251 | |
| 18252 | /* End of Constant: '<S433>/Constant1' */ |
| 18253 | /* End of Outputs for SubSystem: '<S514>/EBC1_0B' */ |
| 18254 | |
| 18255 | /* DataTypeConversion: '<S514>/Data Type Conversion10' */ |
| 18256 | L4_MABX_B.RX_delta_time_h = L4_MABX_B.SFunction1_o25_o; |
| 18257 | |
| 18258 | /* DataTypeConversion: '<S514>/Data Type Conversion8' */ |
| 18259 | L4_MABX_B.RX_status_jg = (L4_MABX_B.SFunction1_o23_o != 0.0); |
| 18260 | |
| 18261 | /* DataTypeConversion: '<S514>/Data Type Conversion9' */ |
| 18262 | L4_MABX_B.RX_time_hf = L4_MABX_B.SFunction1_o24_o; |
| 18263 | |
| 18264 | /* DataTypeConversion: '<S516>/Data Type Conversion10' */ |
| 18265 | L4_MABX_B.RX_delta_time_bo = L4_MABX_B.SFunction1_o25_b; |
| 18266 | |
| 18267 | /* DataTypeConversion: '<S516>/Data Type Conversion8' */ |
| 18268 | L4_MABX_B.RX_status_kg = (L4_MABX_B.SFunction1_o23_p != 0.0); |
| 18269 | |
| 18270 | /* DataTypeConversion: '<S516>/Data Type Conversion9' */ |
| 18271 | L4_MABX_B.RX_time_mj = L4_MABX_B.SFunction1_o24_d; |
| 18272 | |
| 18273 | /* DataTypeConversion: '<S518>/Data Type Conversion10' */ |
| 18274 | L4_MABX_B.RX_delta_time_m = L4_MABX_B.SFunction1_o10_gi; |
| 18275 | |
| 18276 | /* DataTypeConversion: '<S518>/Data Type Conversion8' */ |
| 18277 | L4_MABX_B.RX_status_on = (L4_MABX_B.SFunction1_o8_c != 0.0); |
| 18278 | |
| 18279 | /* DataTypeConversion: '<S518>/Data Type Conversion9' */ |
| 18280 | L4_MABX_B.RX_time_ox = L4_MABX_B.SFunction1_o9_aj; |
| 18281 | |
| 18282 | /* DataTypeConversion: '<S565>/Data Type Conversion10' */ |
| 18283 | L4_MABX_B.RX_delta_time_lr = L4_MABX_B.SFunction1_o11_g; |
| 18284 | |
| 18285 | /* DataTypeConversion: '<S565>/Data Type Conversion8' */ |
| 18286 | L4_MABX_B.RX_status_br = (L4_MABX_B.SFunction1_o9_jd != 0.0); |
| 18287 | |
| 18288 | /* DataTypeConversion: '<S565>/Data Type Conversion9' */ |
| 18289 | L4_MABX_B.RX_time_oe = L4_MABX_B.SFunction1_o10_f; |
| 18290 | |
| 18291 | /* Outputs for Enabled SubSystem: '<S567>/EEC2_001' incorporates: |
| 18292 | * EnablePort: '<S568>/Enable' |
| 18293 | */ |
| 18294 | /* Constant: '<S438>/Enable_RX_EEC2_00' */ |
| 18295 | if (L4_MABX_P.Enable_RX_EEC2_00_Value) { |
| 18296 | /* S-Function (rti_commonblock): '<S568>/S-Function1' */ |
| 18297 | /* This comment workarounds a code generation problem */ |
| 18298 | |
| 18299 | /* dSPACE RTICAN RX Message Block: "EEC2_00" Id:217056000 */ |
| 18300 | { |
| 18301 | UInt32 *CAN_Msg; |
| 18302 | static dsfloat time_old = 0.0; |
| 18303 | |
| 18304 | /* Read status and timestamp info (previous message) */ |
| 18305 | if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0xCF00300].timestamp != |
| 18306 | time_old) { |
| 18307 | /* ... save timestamp info for the calculation of the RX status |
| 18308 | during the consecutive sample hit*/ |
| 18309 | time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0xCF00300]. |
| 18310 | timestamp; |
| 18311 | |
| 18312 | /* ... set the processed flag to one */ |
| 18313 | L4_MABX_B.SFunction1_o15_e = 1.0; |
| 18314 | L4_MABX_B.SFunction1_o16_h = (real_T) |
| 18315 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0xCF00300].timestamp; |
| 18316 | L4_MABX_B.SFunction1_o17_c = (real_T) |
| 18317 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0xCF00300].deltatime; |
| 18318 | CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0xCF00300].data; |
| 18319 | |
| 18320 | /* Decode CAN message */ |
| 18321 | { |
| 18322 | { |
| 18323 | rtican_Signal_t CAN_Sgn; |
| 18324 | |
| 18325 | /* ...... "SPN558_AccelPed1LowIdlSwitch" (0|2, standard signal, unsigned int, little endian) */ |
| 18326 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18327 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18328 | L4_MABX_B.SFunction1_o1_hf = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18329 | |
| 18330 | /* ...... "SPN559_AccelPedKickdownSw" (2|2, standard signal, unsigned int, little endian) */ |
| 18331 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18332 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18333 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18334 | L4_MABX_B.SFunction1_o2_pv = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18335 | |
| 18336 | /* ...... "SPN1437_RoadSpeedLimitStatus" (4|2, standard signal, unsigned int, little endian) */ |
| 18337 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18338 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 18339 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18340 | L4_MABX_B.SFunction1_o3_em = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18341 | |
| 18342 | /* ...... "SPN2970_AccelPed2LowIdlSwitch" (6|2, standard signal, unsigned int, little endian) */ |
| 18343 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18344 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 18345 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18346 | L4_MABX_B.SFunction1_o4_dm = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18347 | |
| 18348 | /* ...... "SPN91_AccelPedPos1" (8|8, standard signal, unsigned int, little endian) */ |
| 18349 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 18350 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18351 | L4_MABX_B.SFunction1_o5_m4 = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 18352 | |
| 18353 | /* ...... "SPN92_EngPercLoadAtCurrSpd" (16|8, standard signal, unsigned int, little endian) */ |
| 18354 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 18355 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18356 | L4_MABX_B.SFunction1_o6_ip = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18357 | |
| 18358 | /* ...... "SPN974_RemAccelPedalPosition" (24|8, standard signal, unsigned int, little endian) */ |
| 18359 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 18360 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18361 | L4_MABX_B.SFunction1_o7_l = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 18362 | |
| 18363 | /* ...... "SPN29_AccelPedPos2" (32|8, standard signal, unsigned int, little endian) */ |
| 18364 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 18365 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18366 | L4_MABX_B.SFunction1_o8_lq = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 18367 | |
| 18368 | /* ...... "SPN2979_VehAccelRateLimStatus" (40|2, standard signal, unsigned int, little endian) */ |
| 18369 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18370 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18371 | L4_MABX_B.SFunction1_o9_jk = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18372 | |
| 18373 | /* ...... "SPN5021_MomEngMaxPwrEnFdbk" (42|2, standard signal, unsigned int, little endian) */ |
| 18374 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18375 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18376 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18377 | L4_MABX_B.SFunction1_o10_p = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18378 | |
| 18379 | /* ...... "SPN5399_DPFThermMgmtActive" (44|2, standard signal, unsigned int, little endian) */ |
| 18380 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18381 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 18382 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18383 | L4_MABX_B.SFunction1_o11_i = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18384 | |
| 18385 | /* ...... "SPN5400_SCRThermMgmtActive" (46|2, standard signal, unsigned int, little endian) */ |
| 18386 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 18387 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6; |
| 18388 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18389 | L4_MABX_B.SFunction1_o12_k = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18390 | |
| 18391 | /* ...... "SPN3357_ActMaxAvailEngPercTrq" (48|8, standard signal, unsigned int, little endian) */ |
| 18392 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 18393 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18394 | L4_MABX_B.SFunction1_o13_o = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 18395 | |
| 18396 | /* ...... "SPN5398_EstPumpingPercentTorque" (56|8, standard signal, unsigned int, little endian) */ |
| 18397 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 18398 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 18399 | L4_MABX_B.SFunction1_o14_g = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 18400 | ); |
| 18401 | } |
| 18402 | } |
| 18403 | } else { |
| 18404 | /* set RX status to 0 because no new message has arrived */ |
| 18405 | L4_MABX_B.SFunction1_o15_e = 0.0; |
| 18406 | } |
| 18407 | } |
| 18408 | } |
| 18409 | |
| 18410 | /* End of Constant: '<S438>/Enable_RX_EEC2_00' */ |
| 18411 | /* End of Outputs for SubSystem: '<S567>/EEC2_001' */ |
| 18412 | |
| 18413 | /* DataTypeConversion: '<S567>/Data Type Conversion10' */ |
| 18414 | L4_MABX_B.RX_delta_time_jt = L4_MABX_B.SFunction1_o17_c; |
| 18415 | |
| 18416 | /* DataTypeConversion: '<S567>/Data Type Conversion8' */ |
| 18417 | L4_MABX_B.RX_status_a = (L4_MABX_B.SFunction1_o15_e != 0.0); |
| 18418 | |
| 18419 | /* DataTypeConversion: '<S567>/Data Type Conversion9' */ |
| 18420 | L4_MABX_B.RX_time_o0 = L4_MABX_B.SFunction1_o16_h; |
| 18421 | |
| 18422 | /* DataTypeConversion: '<S569>/Data Type Conversion10' */ |
| 18423 | L4_MABX_B.RX_delta_time_no = L4_MABX_B.SFunction1_o5_i1; |
| 18424 | |
| 18425 | /* DataTypeConversion: '<S569>/Data Type Conversion8' */ |
| 18426 | L4_MABX_B.RX_status_jb = (L4_MABX_B.SFunction1_o3_jb != 0.0); |
| 18427 | |
| 18428 | /* DataTypeConversion: '<S569>/Data Type Conversion9' */ |
| 18429 | L4_MABX_B.RX_time_l = L4_MABX_B.SFunction1_o4_of; |
| 18430 | |
| 18431 | /* DataTypeConversion: '<S571>/Data Type Conversion10' */ |
| 18432 | L4_MABX_B.RX_delta_time_hy = L4_MABX_B.SFunction1_o6_ks; |
| 18433 | |
| 18434 | /* DataTypeConversion: '<S571>/Data Type Conversion8' */ |
| 18435 | L4_MABX_B.RX_status_gd = (L4_MABX_B.SFunction1_o4_b2 != 0.0); |
| 18436 | |
| 18437 | /* DataTypeConversion: '<S571>/Data Type Conversion9' */ |
| 18438 | L4_MABX_B.RX_time_jz = L4_MABX_B.SFunction1_o5_id; |
| 18439 | |
| 18440 | /* Switch: '<S573>/Switch' */ |
| 18441 | if (L4_MABX_B.RX_status_ol) { |
| 18442 | L4_MABX_B.SID_l = L4_MABX_B.SFunction1_o1_my; |
| 18443 | L4_MABX_B.SetMode = L4_MABX_B.SFunction1_o2_ad; |
| 18444 | L4_MABX_B.OpMode = L4_MABX_B.SFunction1_o3_f3; |
| 18445 | L4_MABX_B.VDOP = L4_MABX_B.SFunction1_o5_b3; |
| 18446 | L4_MABX_B.TDOP = L4_MABX_B.SFunction1_o6_cz; |
| 18447 | L4_MABX_B.RX_status_h = L4_MABX_B.RX_status_ol; |
| 18448 | } else { |
| 18449 | L4_MABX_B.SID_l = L4_MABX_B.SFunction1_o1_ks; |
| 18450 | L4_MABX_B.SetMode = L4_MABX_B.SFunction1_o2_gq; |
| 18451 | L4_MABX_B.OpMode = L4_MABX_B.SFunction1_o3_id; |
| 18452 | L4_MABX_B.VDOP = L4_MABX_B.SFunction1_o5_cs; |
| 18453 | L4_MABX_B.TDOP = L4_MABX_B.SFunction1_o6_na; |
| 18454 | |
| 18455 | /* DataTypeConversion: '<S573>/Data Type Conversion3' */ |
| 18456 | L4_MABX_B.RX_status_kq = (L4_MABX_B.SFunction1_o7_g != 0.0); |
| 18457 | L4_MABX_B.RX_status_h = L4_MABX_B.RX_status_kq; |
| 18458 | } |
| 18459 | |
| 18460 | if (L4_MABX_B.RX_status_ol) { |
| 18461 | /* DataTypeConversion: '<S573>/Data Type Conversion9' */ |
| 18462 | L4_MABX_B.RX_time_cj = L4_MABX_B.SFunction1_o8_g; |
| 18463 | L4_MABX_B.RX_time_g = L4_MABX_B.RX_time_cj; |
| 18464 | |
| 18465 | /* DataTypeConversion: '<S573>/Data Type Conversion10' */ |
| 18466 | L4_MABX_B.RX_delta_time_cg = L4_MABX_B.SFunction1_o9_a; |
| 18467 | L4_MABX_B.RX_delta_time_l0 = L4_MABX_B.RX_delta_time_cg; |
| 18468 | } else { |
| 18469 | /* DataTypeConversion: '<S573>/Data Type Conversion2' */ |
| 18470 | L4_MABX_B.RX_time_l0 = L4_MABX_B.SFunction1_o8_dj; |
| 18471 | L4_MABX_B.RX_time_g = L4_MABX_B.RX_time_l0; |
| 18472 | |
| 18473 | /* DataTypeConversion: '<S573>/Data Type Conversion1' */ |
| 18474 | L4_MABX_B.RX_delta_time_bag = L4_MABX_B.SFunction1_o9_dx; |
| 18475 | L4_MABX_B.RX_delta_time_l0 = L4_MABX_B.RX_delta_time_bag; |
| 18476 | } |
| 18477 | |
| 18478 | /* DataTypeConversion: '<S576>/Data Type Conversion10' */ |
| 18479 | L4_MABX_B.RX_delta_time_pv = L4_MABX_B.SFunction1_o7_iy; |
| 18480 | |
| 18481 | /* DataTypeConversion: '<S576>/Data Type Conversion8' */ |
| 18482 | L4_MABX_B.RX_status_l3 = (L4_MABX_B.SFunction1_o5_j1 != 0.0); |
| 18483 | |
| 18484 | /* DataTypeConversion: '<S576>/Data Type Conversion9' */ |
| 18485 | L4_MABX_B.RX_time_md = L4_MABX_B.SFunction1_o6_gz; |
| 18486 | |
| 18487 | /* Switch: '<S443>/Switch' */ |
| 18488 | if (L4_MABX_B.Operator_bx) { |
| 18489 | ReAX_EchoedSteerWheelPos = L4_MABX_B.SFunction1_o2_e2; |
| 18490 | |
| 18491 | /* DataTypeConversion: '<S578>/Data Type Conversion8' */ |
| 18492 | L4_MABX_B.RX_status_du = (L4_MABX_B.SFunction1_o3_di != 0.0); |
| 18493 | L4_MABX_B.RX_status_bu = L4_MABX_B.RX_status_du; |
| 18494 | |
| 18495 | /* DataTypeConversion: '<S578>/Data Type Conversion9' */ |
| 18496 | L4_MABX_B.RX_time_ay = L4_MABX_B.SFunction1_o4_n; |
| 18497 | L4_MABX_B.RX_time_cl = L4_MABX_B.RX_time_ay; |
| 18498 | |
| 18499 | /* DataTypeConversion: '<S578>/Data Type Conversion10' */ |
| 18500 | L4_MABX_B.RX_delta_time_a5 = L4_MABX_B.SFunction1_o5_i; |
| 18501 | L4_MABX_B.RX_delta_time_e2 = L4_MABX_B.RX_delta_time_a5; |
| 18502 | } else { |
| 18503 | ReAX_EchoedSteerWheelPos = L4_MABX_B.SFunction1_o2_f2; |
| 18504 | |
| 18505 | /* DataTypeConversion: '<S579>/Data Type Conversion8' */ |
| 18506 | L4_MABX_B.RX_status_jd = (L4_MABX_B.SFunction1_o3_mi != 0.0); |
| 18507 | L4_MABX_B.RX_status_bu = L4_MABX_B.RX_status_jd; |
| 18508 | |
| 18509 | /* DataTypeConversion: '<S579>/Data Type Conversion9' */ |
| 18510 | L4_MABX_B.RX_time_fo = L4_MABX_B.SFunction1_o4_b0; |
| 18511 | L4_MABX_B.RX_time_cl = L4_MABX_B.RX_time_fo; |
| 18512 | |
| 18513 | /* DataTypeConversion: '<S579>/Data Type Conversion10' */ |
| 18514 | L4_MABX_B.RX_delta_time_hd = L4_MABX_B.SFunction1_o5_ej; |
| 18515 | L4_MABX_B.RX_delta_time_e2 = L4_MABX_B.RX_delta_time_hd; |
| 18516 | } |
| 18517 | |
| 18518 | /* RelationalOperator: '<S615>/Operator' incorporates: |
| 18519 | * Constant: '<S446>/Constant' |
| 18520 | * Constant: '<S611>/Constant' |
| 18521 | */ |
| 18522 | L4_MABX_B.Operator_aq = (CANR_PROPB_XPR_1_50_CHANNEL_APV == |
| 18523 | L4_MABX_P.Constant_Value_gj); |
| 18524 | |
| 18525 | /* Outputs for Enabled SubSystem: '<S608>/CAN_TYPE1_RX_M1_C1' incorporates: |
| 18526 | * EnablePort: '<S612>/Enable' |
| 18527 | */ |
| 18528 | if (L4_MABX_B.Operator_aq) { |
| 18529 | /* S-Function (rti_commonblock): '<S612>/S-Function1' */ |
| 18530 | /* This comment workarounds a code generation problem */ |
| 18531 | |
| 18532 | /* dSPACE RTICAN RX Message Block: "PropB_XPR_1" Id:419387472 */ |
| 18533 | { |
| 18534 | UInt32 *CAN_Msg; |
| 18535 | static dsfloat time_old = 0.0; |
| 18536 | |
| 18537 | /* Read status and timestamp info (previous message) */ |
| 18538 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FF5850].timestamp != |
| 18539 | time_old) { |
| 18540 | /* ... save timestamp info for the calculation of the RX status |
| 18541 | during the consecutive sample hit*/ |
| 18542 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FF5850]. |
| 18543 | timestamp; |
| 18544 | |
| 18545 | /* ... set the processed flag to one */ |
| 18546 | L4_MABX_B.SFunction1_o3_fj = 1.0; |
| 18547 | L4_MABX_B.SFunction1_o4_ob = (real_T) |
| 18548 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FF5850].timestamp; |
| 18549 | L4_MABX_B.SFunction1_o5_k = (real_T) |
| 18550 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FF5850].deltatime; |
| 18551 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FF5850].data; |
| 18552 | |
| 18553 | /* Decode CAN message */ |
| 18554 | { |
| 18555 | { |
| 18556 | rtican_Signal_t CAN_Sgn; |
| 18557 | |
| 18558 | /* ...... "EPBPCMInhibitStatusFeedback" (0|2, standard signal, unsigned int, little endian) */ |
| 18559 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18560 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18561 | L4_MABX_B.SFunction1_o1_ll = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18562 | |
| 18563 | /* ...... "EPBPCMManualStatusFeedback" (2|2, standard signal, unsigned int, little endian) */ |
| 18564 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18565 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18566 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18567 | L4_MABX_B.SFunction1_o2_b2 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18568 | } |
| 18569 | } |
| 18570 | } else { |
| 18571 | /* set RX status to 0 because no new message has arrived */ |
| 18572 | L4_MABX_B.SFunction1_o3_fj = 0.0; |
| 18573 | } |
| 18574 | } |
| 18575 | } |
| 18576 | |
| 18577 | /* End of Outputs for SubSystem: '<S608>/CAN_TYPE1_RX_M1_C1' */ |
| 18578 | |
| 18579 | /* RelationalOperator: '<S616>/Operator' incorporates: |
| 18580 | * Constant: '<S446>/Constant' |
| 18581 | * Constant: '<S611>/Constant1' |
| 18582 | */ |
| 18583 | L4_MABX_B.Operator_gx = (CANR_PROPB_XPR_1_50_CHANNEL_APV == |
| 18584 | L4_MABX_P.Constant1_Value_k0s); |
| 18585 | |
| 18586 | /* Outputs for Enabled SubSystem: '<S609>/CAN_TYPE1_RX_M1_C2' incorporates: |
| 18587 | * EnablePort: '<S613>/Enable' |
| 18588 | */ |
| 18589 | if (L4_MABX_B.Operator_gx) { |
| 18590 | /* S-Function (rti_commonblock): '<S613>/S-Function1' */ |
| 18591 | /* This comment workarounds a code generation problem */ |
| 18592 | |
| 18593 | /* dSPACE RTICAN RX Message Block: "PropB_XPR_1" Id:419387472 */ |
| 18594 | { |
| 18595 | UInt32 *CAN_Msg; |
| 18596 | static dsfloat time_old = 0.0; |
| 18597 | |
| 18598 | /* Read status and timestamp info (previous message) */ |
| 18599 | if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FF5850].timestamp != |
| 18600 | time_old) { |
| 18601 | /* ... save timestamp info for the calculation of the RX status |
| 18602 | during the consecutive sample hit*/ |
| 18603 | time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FF5850]. |
| 18604 | timestamp; |
| 18605 | |
| 18606 | /* ... set the processed flag to one */ |
| 18607 | L4_MABX_B.SFunction1_o3_h = 1.0; |
| 18608 | L4_MABX_B.SFunction1_o4_es = (real_T) |
| 18609 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FF5850].timestamp; |
| 18610 | L4_MABX_B.SFunction1_o5_no = (real_T) |
| 18611 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FF5850].deltatime; |
| 18612 | CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FF5850].data; |
| 18613 | |
| 18614 | /* Decode CAN message */ |
| 18615 | { |
| 18616 | { |
| 18617 | rtican_Signal_t CAN_Sgn; |
| 18618 | |
| 18619 | /* ...... "EPBPCMInhibitStatusFeedback" (0|2, standard signal, unsigned int, little endian) */ |
| 18620 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18621 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18622 | L4_MABX_B.SFunction1_o1_kd = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18623 | |
| 18624 | /* ...... "EPBPCMManualStatusFeedback" (2|2, standard signal, unsigned int, little endian) */ |
| 18625 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18626 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18627 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18628 | L4_MABX_B.SFunction1_o2_lm = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18629 | } |
| 18630 | } |
| 18631 | } else { |
| 18632 | /* set RX status to 0 because no new message has arrived */ |
| 18633 | L4_MABX_B.SFunction1_o3_h = 0.0; |
| 18634 | } |
| 18635 | } |
| 18636 | } |
| 18637 | |
| 18638 | /* End of Outputs for SubSystem: '<S609>/CAN_TYPE1_RX_M1_C2' */ |
| 18639 | |
| 18640 | /* RelationalOperator: '<S617>/Operator' incorporates: |
| 18641 | * Constant: '<S446>/Constant' |
| 18642 | * Constant: '<S611>/Constant2' |
| 18643 | */ |
| 18644 | L4_MABX_B.Operator_m1d = (CANR_PROPB_XPR_1_50_CHANNEL_APV == |
| 18645 | L4_MABX_P.Constant2_Value_by); |
| 18646 | |
| 18647 | /* Outputs for Enabled SubSystem: '<S610>/CAN_TYPE1_RX_M2_C1' incorporates: |
| 18648 | * EnablePort: '<S614>/Enable' |
| 18649 | */ |
| 18650 | if (L4_MABX_B.Operator_m1d) { |
| 18651 | /* S-Function (rti_commonblock): '<S614>/S-Function1' */ |
| 18652 | /* This comment workarounds a code generation problem */ |
| 18653 | |
| 18654 | /* dSPACE RTICAN RX Message Block: "PropB_XPR_1" Id:419387472 */ |
| 18655 | { |
| 18656 | UInt32 *CAN_Msg; |
| 18657 | static dsfloat time_old = 0.0; |
| 18658 | |
| 18659 | /* Read status and timestamp info (previous message) */ |
| 18660 | if (can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF5850].timestamp != |
| 18661 | time_old) { |
| 18662 | /* ... save timestamp info for the calculation of the RX status |
| 18663 | during the consecutive sample hit*/ |
| 18664 | time_old = can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF5850]. |
| 18665 | timestamp; |
| 18666 | |
| 18667 | /* ... set the processed flag to one */ |
| 18668 | L4_MABX_B.SFunction1_o3_d3 = 1.0; |
| 18669 | L4_MABX_B.SFunction1_o4_cvz = (real_T) |
| 18670 | can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF5850].timestamp; |
| 18671 | L4_MABX_B.SFunction1_o5_n3 = (real_T) |
| 18672 | can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF5850].deltatime; |
| 18673 | CAN_Msg = can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF5850].data; |
| 18674 | |
| 18675 | /* Decode CAN message */ |
| 18676 | { |
| 18677 | { |
| 18678 | rtican_Signal_t CAN_Sgn; |
| 18679 | |
| 18680 | /* ...... "EPBPCMInhibitStatusFeedback" (0|2, standard signal, unsigned int, little endian) */ |
| 18681 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18682 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18683 | L4_MABX_B.SFunction1_o1_fk = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18684 | |
| 18685 | /* ...... "EPBPCMManualStatusFeedback" (2|2, standard signal, unsigned int, little endian) */ |
| 18686 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 18687 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 18688 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 18689 | L4_MABX_B.SFunction1_o2_es = ((real_T) CAN_Sgn.UnsignedSgn); |
| 18690 | } |
| 18691 | } |
| 18692 | } else { |
| 18693 | /* set RX status to 0 because no new message has arrived */ |
| 18694 | L4_MABX_B.SFunction1_o3_d3 = 0.0; |
| 18695 | } |
| 18696 | } |
| 18697 | } |
| 18698 | |
| 18699 | /* End of Outputs for SubSystem: '<S610>/CAN_TYPE1_RX_M2_C1' */ |
| 18700 | |
| 18701 | /* DataTypeConversion: '<S610>/Data Type Conversion' */ |
| 18702 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_fk; |
| 18703 | if (PositionFinalLimited < 256.0) { |
| 18704 | if (PositionFinalLimited >= 0.0) { |
| 18705 | starting_index = (uint8_T)PositionFinalLimited; |
| 18706 | } else { |
| 18707 | starting_index = 0U; |
| 18708 | } |
| 18709 | } else { |
| 18710 | starting_index = MAX_uint8_T; |
| 18711 | } |
| 18712 | |
| 18713 | L4_MABX_B.DataTypeConversion_oh = starting_index; |
| 18714 | |
| 18715 | /* End of DataTypeConversion: '<S610>/Data Type Conversion' */ |
| 18716 | |
| 18717 | /* DataTypeConversion: '<S610>/Data Type Conversion2' */ |
| 18718 | L4_MABX_B.EPBPCMInhibitStatusFeedback = (ENUM_XPR_FEEDBACK_T) |
| 18719 | L4_MABX_B.DataTypeConversion_oh; |
| 18720 | |
| 18721 | /* MultiPortSwitch: '<S446>/Multiport_Switch' incorporates: |
| 18722 | * Constant: '<S446>/Constant' |
| 18723 | */ |
| 18724 | switch (CANR_PROPB_XPR_1_50_CHANNEL_APV) { |
| 18725 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 18726 | /* DataTypeConversion: '<S608>/Data Type Conversion' */ |
| 18727 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_ll; |
| 18728 | if (PositionFinalLimited < 256.0) { |
| 18729 | if (PositionFinalLimited >= 0.0) { |
| 18730 | starting_index = (uint8_T)PositionFinalLimited; |
| 18731 | } else { |
| 18732 | starting_index = 0U; |
| 18733 | } |
| 18734 | } else { |
| 18735 | starting_index = MAX_uint8_T; |
| 18736 | } |
| 18737 | |
| 18738 | L4_MABX_B.DataTypeConversion_lmq = starting_index; |
| 18739 | |
| 18740 | /* End of DataTypeConversion: '<S608>/Data Type Conversion' */ |
| 18741 | |
| 18742 | /* DataTypeConversion: '<S608>/Data Type Conversion2' */ |
| 18743 | L4_MABX_B.EPBPCMInhibitStatusFeedback_d = (ENUM_XPR_FEEDBACK_T) |
| 18744 | L4_MABX_B.DataTypeConversion_lmq; |
| 18745 | L4_MABX_B.EPBPCMInhibitStatusFeedback_k = |
| 18746 | L4_MABX_B.EPBPCMInhibitStatusFeedback_d; |
| 18747 | break; |
| 18748 | |
| 18749 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 18750 | /* DataTypeConversion: '<S609>/Data Type Conversion' */ |
| 18751 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_kd; |
| 18752 | if (PositionFinalLimited < 256.0) { |
| 18753 | if (PositionFinalLimited >= 0.0) { |
| 18754 | starting_index = (uint8_T)PositionFinalLimited; |
| 18755 | } else { |
| 18756 | starting_index = 0U; |
| 18757 | } |
| 18758 | } else { |
| 18759 | starting_index = MAX_uint8_T; |
| 18760 | } |
| 18761 | |
| 18762 | L4_MABX_B.DataTypeConversion_ak = starting_index; |
| 18763 | |
| 18764 | /* End of DataTypeConversion: '<S609>/Data Type Conversion' */ |
| 18765 | |
| 18766 | /* DataTypeConversion: '<S609>/Data Type Conversion2' */ |
| 18767 | L4_MABX_B.EPBPCMInhibitStatusFeedback_m = (ENUM_XPR_FEEDBACK_T) |
| 18768 | L4_MABX_B.DataTypeConversion_ak; |
| 18769 | L4_MABX_B.EPBPCMInhibitStatusFeedback_k = |
| 18770 | L4_MABX_B.EPBPCMInhibitStatusFeedback_m; |
| 18771 | break; |
| 18772 | |
| 18773 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 18774 | L4_MABX_B.EPBPCMInhibitStatusFeedback_k = |
| 18775 | L4_MABX_B.EPBPCMInhibitStatusFeedback; |
| 18776 | break; |
| 18777 | |
| 18778 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 18779 | L4_MABX_B.EPBPCMInhibitStatusFeedback_k = |
| 18780 | L4_MABX_B.EPBPCMInhibitStatusFeedback; |
| 18781 | break; |
| 18782 | |
| 18783 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 18784 | L4_MABX_B.EPBPCMInhibitStatusFeedback_k = |
| 18785 | L4_MABX_B.EPBPCMInhibitStatusFeedback; |
| 18786 | break; |
| 18787 | |
| 18788 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 18789 | L4_MABX_B.EPBPCMInhibitStatusFeedback_k = |
| 18790 | L4_MABX_B.EPBPCMInhibitStatusFeedback; |
| 18791 | break; |
| 18792 | |
| 18793 | default: |
| 18794 | L4_MABX_B.EPBPCMInhibitStatusFeedback_k = |
| 18795 | L4_MABX_B.EPBPCMInhibitStatusFeedback; |
| 18796 | break; |
| 18797 | } |
| 18798 | |
| 18799 | /* DataTypeConversion: '<S610>/Data Type Conversion1' */ |
| 18800 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_es; |
| 18801 | if (PositionFinalLimited < 256.0) { |
| 18802 | if (PositionFinalLimited >= 0.0) { |
| 18803 | starting_index = (uint8_T)PositionFinalLimited; |
| 18804 | } else { |
| 18805 | starting_index = 0U; |
| 18806 | } |
| 18807 | } else { |
| 18808 | starting_index = MAX_uint8_T; |
| 18809 | } |
| 18810 | |
| 18811 | L4_MABX_B.DataTypeConversion1_kv = starting_index; |
| 18812 | |
| 18813 | /* End of DataTypeConversion: '<S610>/Data Type Conversion1' */ |
| 18814 | |
| 18815 | /* DataTypeConversion: '<S610>/Data Type Conversion3' */ |
| 18816 | L4_MABX_B.EPBPCMManualStatusFeedback = (ENUM_XPR_FEEDBACK_T) |
| 18817 | L4_MABX_B.DataTypeConversion1_kv; |
| 18818 | |
| 18819 | /* MultiPortSwitch: '<S446>/Multiport_Switch' incorporates: |
| 18820 | * Constant: '<S446>/Constant' |
| 18821 | */ |
| 18822 | switch (CANR_PROPB_XPR_1_50_CHANNEL_APV) { |
| 18823 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 18824 | /* DataTypeConversion: '<S608>/Data Type Conversion1' */ |
| 18825 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_b2; |
| 18826 | if (PositionFinalLimited < 256.0) { |
| 18827 | if (PositionFinalLimited >= 0.0) { |
| 18828 | starting_index = (uint8_T)PositionFinalLimited; |
| 18829 | } else { |
| 18830 | starting_index = 0U; |
| 18831 | } |
| 18832 | } else { |
| 18833 | starting_index = MAX_uint8_T; |
| 18834 | } |
| 18835 | |
| 18836 | L4_MABX_B.DataTypeConversion1_pm = starting_index; |
| 18837 | |
| 18838 | /* End of DataTypeConversion: '<S608>/Data Type Conversion1' */ |
| 18839 | |
| 18840 | /* DataTypeConversion: '<S608>/Data Type Conversion3' */ |
| 18841 | L4_MABX_B.EPBPCMManualStatusFeedback_f = (ENUM_XPR_FEEDBACK_T) |
| 18842 | L4_MABX_B.DataTypeConversion1_pm; |
| 18843 | L4_MABX_B.EPBPCMManualStatusFeedback_p = |
| 18844 | L4_MABX_B.EPBPCMManualStatusFeedback_f; |
| 18845 | break; |
| 18846 | |
| 18847 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 18848 | /* DataTypeConversion: '<S609>/Data Type Conversion1' */ |
| 18849 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_lm; |
| 18850 | if (PositionFinalLimited < 256.0) { |
| 18851 | if (PositionFinalLimited >= 0.0) { |
| 18852 | starting_index = (uint8_T)PositionFinalLimited; |
| 18853 | } else { |
| 18854 | starting_index = 0U; |
| 18855 | } |
| 18856 | } else { |
| 18857 | starting_index = MAX_uint8_T; |
| 18858 | } |
| 18859 | |
| 18860 | L4_MABX_B.DataTypeConversion1_ly = starting_index; |
| 18861 | |
| 18862 | /* End of DataTypeConversion: '<S609>/Data Type Conversion1' */ |
| 18863 | |
| 18864 | /* DataTypeConversion: '<S609>/Data Type Conversion3' */ |
| 18865 | L4_MABX_B.EPBPCMManualStatusFeedback_m = (ENUM_XPR_FEEDBACK_T) |
| 18866 | L4_MABX_B.DataTypeConversion1_ly; |
| 18867 | L4_MABX_B.EPBPCMManualStatusFeedback_p = |
| 18868 | L4_MABX_B.EPBPCMManualStatusFeedback_m; |
| 18869 | break; |
| 18870 | |
| 18871 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 18872 | L4_MABX_B.EPBPCMManualStatusFeedback_p = |
| 18873 | L4_MABX_B.EPBPCMManualStatusFeedback; |
| 18874 | break; |
| 18875 | |
| 18876 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 18877 | L4_MABX_B.EPBPCMManualStatusFeedback_p = |
| 18878 | L4_MABX_B.EPBPCMManualStatusFeedback; |
| 18879 | break; |
| 18880 | |
| 18881 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 18882 | L4_MABX_B.EPBPCMManualStatusFeedback_p = |
| 18883 | L4_MABX_B.EPBPCMManualStatusFeedback; |
| 18884 | break; |
| 18885 | |
| 18886 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 18887 | L4_MABX_B.EPBPCMManualStatusFeedback_p = |
| 18888 | L4_MABX_B.EPBPCMManualStatusFeedback; |
| 18889 | break; |
| 18890 | |
| 18891 | default: |
| 18892 | L4_MABX_B.EPBPCMManualStatusFeedback_p = |
| 18893 | L4_MABX_B.EPBPCMManualStatusFeedback; |
| 18894 | break; |
| 18895 | } |
| 18896 | |
| 18897 | /* DataTypeConversion: '<S610>/Data Type Conversion8' */ |
| 18898 | L4_MABX_B.RX_status_bv = (L4_MABX_B.SFunction1_o3_d3 != 0.0); |
| 18899 | |
| 18900 | /* MultiPortSwitch: '<S446>/Multiport_Switch' incorporates: |
| 18901 | * Constant: '<S446>/Constant' |
| 18902 | */ |
| 18903 | switch (CANR_PROPB_XPR_1_50_CHANNEL_APV) { |
| 18904 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 18905 | /* DataTypeConversion: '<S608>/Data Type Conversion8' */ |
| 18906 | L4_MABX_B.RX_status_am = (L4_MABX_B.SFunction1_o3_fj != 0.0); |
| 18907 | L4_MABX_B.RX_status_o3 = L4_MABX_B.RX_status_am; |
| 18908 | break; |
| 18909 | |
| 18910 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 18911 | /* DataTypeConversion: '<S609>/Data Type Conversion8' */ |
| 18912 | L4_MABX_B.RX_status_hw = (L4_MABX_B.SFunction1_o3_h != 0.0); |
| 18913 | L4_MABX_B.RX_status_o3 = L4_MABX_B.RX_status_hw; |
| 18914 | break; |
| 18915 | |
| 18916 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 18917 | L4_MABX_B.RX_status_o3 = L4_MABX_B.RX_status_bv; |
| 18918 | break; |
| 18919 | |
| 18920 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 18921 | L4_MABX_B.RX_status_o3 = L4_MABX_B.RX_status_bv; |
| 18922 | break; |
| 18923 | |
| 18924 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 18925 | L4_MABX_B.RX_status_o3 = L4_MABX_B.RX_status_bv; |
| 18926 | break; |
| 18927 | |
| 18928 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 18929 | L4_MABX_B.RX_status_o3 = L4_MABX_B.RX_status_bv; |
| 18930 | break; |
| 18931 | |
| 18932 | default: |
| 18933 | L4_MABX_B.RX_status_o3 = L4_MABX_B.RX_status_bv; |
| 18934 | break; |
| 18935 | } |
| 18936 | |
| 18937 | /* DataTypeConversion: '<S610>/Data Type Conversion9' */ |
| 18938 | L4_MABX_B.RX_time_jl = L4_MABX_B.SFunction1_o4_cvz; |
| 18939 | |
| 18940 | /* MultiPortSwitch: '<S446>/Multiport_Switch' incorporates: |
| 18941 | * Constant: '<S446>/Constant' |
| 18942 | */ |
| 18943 | switch (CANR_PROPB_XPR_1_50_CHANNEL_APV) { |
| 18944 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 18945 | /* DataTypeConversion: '<S608>/Data Type Conversion9' */ |
| 18946 | L4_MABX_B.RX_time_oxc = L4_MABX_B.SFunction1_o4_ob; |
| 18947 | L4_MABX_B.RX_time_oj = L4_MABX_B.RX_time_oxc; |
| 18948 | break; |
| 18949 | |
| 18950 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 18951 | /* DataTypeConversion: '<S609>/Data Type Conversion9' */ |
| 18952 | L4_MABX_B.RX_time_ek = L4_MABX_B.SFunction1_o4_es; |
| 18953 | L4_MABX_B.RX_time_oj = L4_MABX_B.RX_time_ek; |
| 18954 | break; |
| 18955 | |
| 18956 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 18957 | L4_MABX_B.RX_time_oj = L4_MABX_B.RX_time_jl; |
| 18958 | break; |
| 18959 | |
| 18960 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 18961 | L4_MABX_B.RX_time_oj = L4_MABX_B.RX_time_jl; |
| 18962 | break; |
| 18963 | |
| 18964 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 18965 | L4_MABX_B.RX_time_oj = L4_MABX_B.RX_time_jl; |
| 18966 | break; |
| 18967 | |
| 18968 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 18969 | L4_MABX_B.RX_time_oj = L4_MABX_B.RX_time_jl; |
| 18970 | break; |
| 18971 | |
| 18972 | default: |
| 18973 | L4_MABX_B.RX_time_oj = L4_MABX_B.RX_time_jl; |
| 18974 | break; |
| 18975 | } |
| 18976 | |
| 18977 | /* DataTypeConversion: '<S610>/Data Type Conversion10' */ |
| 18978 | L4_MABX_B.RX_delta_time_j0 = L4_MABX_B.SFunction1_o5_n3; |
| 18979 | |
| 18980 | /* MultiPortSwitch: '<S446>/Multiport_Switch' incorporates: |
| 18981 | * Constant: '<S446>/Constant' |
| 18982 | */ |
| 18983 | switch (CANR_PROPB_XPR_1_50_CHANNEL_APV) { |
| 18984 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 18985 | /* DataTypeConversion: '<S608>/Data Type Conversion10' */ |
| 18986 | L4_MABX_B.RX_delta_time_fv = L4_MABX_B.SFunction1_o5_k; |
| 18987 | L4_MABX_B.RX_delta_time_bg = L4_MABX_B.RX_delta_time_fv; |
| 18988 | break; |
| 18989 | |
| 18990 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 18991 | /* DataTypeConversion: '<S609>/Data Type Conversion10' */ |
| 18992 | L4_MABX_B.RX_delta_time_c1 = L4_MABX_B.SFunction1_o5_no; |
| 18993 | L4_MABX_B.RX_delta_time_bg = L4_MABX_B.RX_delta_time_c1; |
| 18994 | break; |
| 18995 | |
| 18996 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 18997 | L4_MABX_B.RX_delta_time_bg = L4_MABX_B.RX_delta_time_j0; |
| 18998 | break; |
| 18999 | |
| 19000 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 19001 | L4_MABX_B.RX_delta_time_bg = L4_MABX_B.RX_delta_time_j0; |
| 19002 | break; |
| 19003 | |
| 19004 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 19005 | L4_MABX_B.RX_delta_time_bg = L4_MABX_B.RX_delta_time_j0; |
| 19006 | break; |
| 19007 | |
| 19008 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 19009 | L4_MABX_B.RX_delta_time_bg = L4_MABX_B.RX_delta_time_j0; |
| 19010 | break; |
| 19011 | |
| 19012 | default: |
| 19013 | L4_MABX_B.RX_delta_time_bg = L4_MABX_B.RX_delta_time_j0; |
| 19014 | break; |
| 19015 | } |
| 19016 | |
| 19017 | /* RelationalOperator: '<S618>/Operator' incorporates: |
| 19018 | * Constant: '<S446>/Constant' |
| 19019 | * Constant: '<S611>/Constant3' |
| 19020 | */ |
| 19021 | L4_MABX_B.Operator_p1 = (CANR_PROPB_XPR_1_50_CHANNEL_APV == |
| 19022 | L4_MABX_P.Constant3_Value_mr); |
| 19023 | |
| 19024 | /* RelationalOperator: '<S619>/Operator' incorporates: |
| 19025 | * Constant: '<S446>/Constant' |
| 19026 | * Constant: '<S611>/Constant4' |
| 19027 | */ |
| 19028 | L4_MABX_B.Operator_ll = (CANR_PROPB_XPR_1_50_CHANNEL_APV == |
| 19029 | L4_MABX_P.Constant4_Value_oq); |
| 19030 | |
| 19031 | /* RelationalOperator: '<S620>/Operator' incorporates: |
| 19032 | * Constant: '<S446>/Constant' |
| 19033 | * Constant: '<S611>/Constant5' |
| 19034 | */ |
| 19035 | L4_MABX_B.Operator_ncj = (CANR_PROPB_XPR_1_50_CHANNEL_APV == |
| 19036 | L4_MABX_P.Constant5_Value_f); |
| 19037 | |
| 19038 | /* Outputs for Enabled SubSystem: '<S621>/PX2_LaneEdgeLeft' incorporates: |
| 19039 | * EnablePort: '<S622>/Enable' |
| 19040 | */ |
| 19041 | /* Constant: '<S447>/Constant' */ |
| 19042 | if (L4_MABX_P.Constant_Value_mx) { |
| 19043 | /* S-Function (rti_commonblock): '<S622>/S-Function1' */ |
| 19044 | /* This comment workarounds a code generation problem */ |
| 19045 | |
| 19046 | /* dSPACE RTICAN RX Message Block: "PX2_LaneEdgeLeft" Id:770 */ |
| 19047 | { |
| 19048 | UInt32 *CAN_Msg; |
| 19049 | static dsfloat time_old = 0.0; |
| 19050 | |
| 19051 | /* Read status and timestamp info (previous message) */ |
| 19052 | if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x302].timestamp != |
| 19053 | time_old) { |
| 19054 | /* ... save timestamp info for the calculation of the RX status |
| 19055 | during the consecutive sample hit*/ |
| 19056 | time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x302].timestamp; |
| 19057 | |
| 19058 | /* ... set the processed flag to one */ |
| 19059 | L4_MABX_B.SFunction1_o4_fr = 1.0; |
| 19060 | L4_MABX_B.SFunction1_o5_j = (real_T) |
| 19061 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x302].timestamp; |
| 19062 | L4_MABX_B.SFunction1_o6_dw = (real_T) |
| 19063 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x302].deltatime; |
| 19064 | CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x302].data; |
| 19065 | |
| 19066 | /* Decode CAN message */ |
| 19067 | { |
| 19068 | { |
| 19069 | rtican_Signal_t CAN_Sgn; |
| 19070 | |
| 19071 | /* ...... "PX2_LaneEdgeLeftAngle" (0|16, standard signal, signed int, little endian) */ |
| 19072 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 19073 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 19074 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19075 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19076 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19077 | } |
| 19078 | |
| 19079 | L4_MABX_B.SFunction1_o1_oj = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 19080 | |
| 19081 | /* ...... "PX2_LaneEdgeLeftNumPoints" (16|8, standard signal, unsigned int, little endian) */ |
| 19082 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 19083 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 19084 | L4_MABX_B.SFunction1_o2_h2 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19085 | |
| 19086 | /* ...... "PX2_LaneEdgeLeftPosition" (24|16, standard signal, signed int, little endian) */ |
| 19087 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 19088 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 19089 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19090 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19091 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19092 | } |
| 19093 | |
| 19094 | L4_MABX_B.SFunction1_o3_im = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 19095 | } |
| 19096 | } |
| 19097 | } else { |
| 19098 | /* set RX status to 0 because no new message has arrived */ |
| 19099 | L4_MABX_B.SFunction1_o4_fr = 0.0; |
| 19100 | } |
| 19101 | } |
| 19102 | } |
| 19103 | |
| 19104 | /* End of Outputs for SubSystem: '<S621>/PX2_LaneEdgeLeft' */ |
| 19105 | |
| 19106 | /* DataTypeConversion: '<S621>/Data Type Conversion1' */ |
| 19107 | L4_MABX_B.RX_delta_time_f = L4_MABX_B.SFunction1_o6_dw; |
| 19108 | |
| 19109 | /* DataTypeConversion: '<S621>/Data Type Conversion10' */ |
| 19110 | L4_MABX_B.RX_delta_time_ft = L4_MABX_B.SFunction1_o7_aw; |
| 19111 | |
| 19112 | /* DataTypeConversion: '<S621>/Data Type Conversion2' */ |
| 19113 | L4_MABX_B.RX_status_jt = (L4_MABX_B.SFunction1_o4_fr != 0.0); |
| 19114 | |
| 19115 | /* DataTypeConversion: '<S621>/Data Type Conversion3' */ |
| 19116 | L4_MABX_B.RX_time_np = L4_MABX_B.SFunction1_o5_j; |
| 19117 | |
| 19118 | /* Outputs for Enabled SubSystem: '<S621>/PX2_LaneEdgeRight' incorporates: |
| 19119 | * EnablePort: '<S623>/Enable' |
| 19120 | */ |
| 19121 | /* Constant: '<S447>/Constant' */ |
| 19122 | if (L4_MABX_P.Constant_Value_mx) { |
| 19123 | /* S-Function (rti_commonblock): '<S623>/S-Function1' */ |
| 19124 | /* This comment workarounds a code generation problem */ |
| 19125 | |
| 19126 | /* dSPACE RTICAN RX Message Block: "PX2_LaneEdgeRight" Id:771 */ |
| 19127 | { |
| 19128 | UInt32 *CAN_Msg; |
| 19129 | static dsfloat time_old = 0.0; |
| 19130 | |
| 19131 | /* Read status and timestamp info (previous message) */ |
| 19132 | if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x303].timestamp != |
| 19133 | time_old) { |
| 19134 | /* ... save timestamp info for the calculation of the RX status |
| 19135 | during the consecutive sample hit*/ |
| 19136 | time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x303].timestamp; |
| 19137 | |
| 19138 | /* ... set the processed flag to one */ |
| 19139 | L4_MABX_B.SFunction1_o4_c3 = 1.0; |
| 19140 | L4_MABX_B.SFunction1_o5_c = (real_T) |
| 19141 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x303].timestamp; |
| 19142 | L4_MABX_B.SFunction1_o6_kd = (real_T) |
| 19143 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x303].deltatime; |
| 19144 | CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x303].data; |
| 19145 | |
| 19146 | /* Decode CAN message */ |
| 19147 | { |
| 19148 | { |
| 19149 | rtican_Signal_t CAN_Sgn; |
| 19150 | |
| 19151 | /* ...... "PX2_LaneEdgeRightAngle" (0|16, standard signal, signed int, little endian) */ |
| 19152 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 19153 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 19154 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19155 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19156 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19157 | } |
| 19158 | |
| 19159 | L4_MABX_B.SFunction1_o1_lc = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 19160 | |
| 19161 | /* ...... "PX2_LaneEdgeRightNumPoints" (16|8, standard signal, unsigned int, little endian) */ |
| 19162 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 19163 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 19164 | L4_MABX_B.SFunction1_o2_fl = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19165 | |
| 19166 | /* ...... "PX2_LaneEdgeRightPosition" (24|16, standard signal, signed int, little endian) */ |
| 19167 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 19168 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4]; |
| 19169 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19170 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19171 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19172 | } |
| 19173 | |
| 19174 | L4_MABX_B.SFunction1_o3_n = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 19175 | } |
| 19176 | } |
| 19177 | } else { |
| 19178 | /* set RX status to 0 because no new message has arrived */ |
| 19179 | L4_MABX_B.SFunction1_o4_c3 = 0.0; |
| 19180 | } |
| 19181 | } |
| 19182 | } |
| 19183 | |
| 19184 | /* End of Outputs for SubSystem: '<S621>/PX2_LaneEdgeRight' */ |
| 19185 | |
| 19186 | /* DataTypeConversion: '<S621>/Data Type Conversion4' */ |
| 19187 | L4_MABX_B.RX_delta_time_kw = L4_MABX_B.SFunction1_o6_kd; |
| 19188 | |
| 19189 | /* DataTypeConversion: '<S621>/Data Type Conversion5' */ |
| 19190 | L4_MABX_B.RX_status_fy = (L4_MABX_B.SFunction1_o4_c3 != 0.0); |
| 19191 | |
| 19192 | /* DataTypeConversion: '<S621>/Data Type Conversion6' */ |
| 19193 | L4_MABX_B.RX_time_pd = L4_MABX_B.SFunction1_o5_c; |
| 19194 | |
| 19195 | /* DataTypeConversion: '<S621>/Data Type Conversion8' */ |
| 19196 | L4_MABX_B.RX_status_k0 = (L4_MABX_B.SFunction1_o5_et != 0.0); |
| 19197 | |
| 19198 | /* DataTypeConversion: '<S621>/Data Type Conversion9' */ |
| 19199 | L4_MABX_B.RX_time_jl2 = L4_MABX_B.SFunction1_o6_h; |
| 19200 | |
| 19201 | /* Switch: '<S625>/Switch' */ |
| 19202 | if (L4_MABX_B.If_Then_Else.Switch) { |
| 19203 | /* DataTypeConversion: '<S625>/Data Type Conversion8' */ |
| 19204 | L4_MABX_B.RX_status_el = (L4_MABX_B.SFunction1_o3_lm != 0.0); |
| 19205 | L4_MABX_B.RX_status_p = L4_MABX_B.RX_status_el; |
| 19206 | |
| 19207 | /* DataTypeConversion: '<S625>/Data Type Conversion9' */ |
| 19208 | L4_MABX_B.RX_time_i2 = L4_MABX_B.SFunction1_o4_aq; |
| 19209 | L4_MABX_B.RX_time_my = L4_MABX_B.RX_time_i2; |
| 19210 | |
| 19211 | /* DataTypeConversion: '<S625>/Data Type Conversion10' */ |
| 19212 | L4_MABX_B.RX_delta_time_n5 = L4_MABX_B.SFunction1_o5_o; |
| 19213 | L4_MABX_B.RX_delta_time_ba = L4_MABX_B.RX_delta_time_n5; |
| 19214 | } else { |
| 19215 | /* DataTypeConversion: '<S625>/Data Type Conversion3' */ |
| 19216 | L4_MABX_B.RX_status_eq = (L4_MABX_B.SFunction1_o3_lxw != 0.0); |
| 19217 | L4_MABX_B.RX_status_p = L4_MABX_B.RX_status_eq; |
| 19218 | |
| 19219 | /* DataTypeConversion: '<S625>/Data Type Conversion2' */ |
| 19220 | L4_MABX_B.RX_time_cx0 = L4_MABX_B.SFunction1_o4_ls; |
| 19221 | L4_MABX_B.RX_time_my = L4_MABX_B.RX_time_cx0; |
| 19222 | |
| 19223 | /* DataTypeConversion: '<S625>/Data Type Conversion1' */ |
| 19224 | L4_MABX_B.RX_delta_time_c = L4_MABX_B.SFunction1_o5_f; |
| 19225 | L4_MABX_B.RX_delta_time_ba = L4_MABX_B.RX_delta_time_c; |
| 19226 | } |
| 19227 | |
| 19228 | /* DataTypeConversion: '<S628>/Data Type Conversion1' */ |
| 19229 | L4_MABX_B.XPR1ControlStatus = L4_MABX_B.SFunction1_o6_b2; |
| 19230 | |
| 19231 | /* DataTypeConversion: '<S628>/Data Type Conversion10' */ |
| 19232 | L4_MABX_B.RX_delta_time_bl = L4_MABX_B.SFunction1_o13_b; |
| 19233 | |
| 19234 | /* DataTypeConversion: '<S628>/Data Type Conversion2' */ |
| 19235 | L4_MABX_B.XPR2ControlStatus = L4_MABX_B.SFunction1_o7_cy; |
| 19236 | |
| 19237 | /* DataTypeConversion: '<S628>/Data Type Conversion3' */ |
| 19238 | L4_MABX_B.XPR3ControlStatus = L4_MABX_B.SFunction1_o8_a5; |
| 19239 | |
| 19240 | /* DataTypeConversion: '<S628>/Data Type Conversion8' */ |
| 19241 | L4_MABX_B.RX_status_gq = (L4_MABX_B.SFunction1_o11_p != 0.0); |
| 19242 | |
| 19243 | /* DataTypeConversion: '<S628>/Data Type Conversion9' */ |
| 19244 | L4_MABX_B.RX_time_i = L4_MABX_B.SFunction1_o12_i; |
| 19245 | |
| 19246 | /* DataTypeConversion: '<S630>/Data Type Conversion10' */ |
| 19247 | L4_MABX_B.RX_delta_time_ku = L4_MABX_B.SFunction1_o10_n; |
| 19248 | |
| 19249 | /* DataTypeConversion: '<S630>/Data Type Conversion8' */ |
| 19250 | L4_MABX_B.RX_status_lm = (L4_MABX_B.SFunction1_o8_b4 != 0.0); |
| 19251 | |
| 19252 | /* DataTypeConversion: '<S630>/Data Type Conversion9' */ |
| 19253 | L4_MABX_B.RX_time_j5 = L4_MABX_B.SFunction1_o9_k; |
| 19254 | |
| 19255 | /* Outputs for Enabled SubSystem: '<S632>/PX2_MapLaneEgoLeft' incorporates: |
| 19256 | * EnablePort: '<S633>/Enable' |
| 19257 | */ |
| 19258 | /* Constant: '<S451>/CAN_RX-Enable_PX2_MapLaneEgoLeft' */ |
| 19259 | if (L4_MABX_P.CAN_RXEnable_PX2_MapLaneEgoLeft) { |
| 19260 | /* S-Function (rti_commonblock): '<S633>/S-Function1' */ |
| 19261 | /* This comment workarounds a code generation problem */ |
| 19262 | |
| 19263 | /* dSPACE RTICAN RX Message Block: "PX2_MapLaneEgoLeft" Id:1542 */ |
| 19264 | { |
| 19265 | UInt32 *CAN_Msg; |
| 19266 | static dsfloat time_old = 0.0; |
| 19267 | |
| 19268 | /* Read status and timestamp info (previous message) */ |
| 19269 | if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x606].timestamp != |
| 19270 | time_old) { |
| 19271 | /* ... save timestamp info for the calculation of the RX status |
| 19272 | during the consecutive sample hit*/ |
| 19273 | time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x606].timestamp; |
| 19274 | |
| 19275 | /* ... set the processed flag to one */ |
| 19276 | L4_MABX_B.SFunction1_o7_b = 1.0; |
| 19277 | L4_MABX_B.SFunction1_o8_a1 = (real_T) |
| 19278 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x606].timestamp; |
| 19279 | L4_MABX_B.SFunction1_o9_l = (real_T) |
| 19280 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x606].deltatime; |
| 19281 | CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x606].data; |
| 19282 | |
| 19283 | /* Decode CAN message */ |
| 19284 | { |
| 19285 | { |
| 19286 | rtican_Signal_t CAN_Sgn; |
| 19287 | |
| 19288 | /* ...... "PX2_MapLaneNearPos" (0|16, standard signal, signed int, little endian) */ |
| 19289 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 19290 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 19291 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19292 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19293 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19294 | } |
| 19295 | |
| 19296 | L4_MABX_B.SFunction1_o1_mg = 0.00390625 * ( ((real_T) |
| 19297 | CAN_Sgn.SignedSgn) ); |
| 19298 | |
| 19299 | /* ...... "PX2_MapLaneMidPos" (16|16, standard signal, signed int, little endian) */ |
| 19300 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 19301 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 19302 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19303 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19304 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19305 | } |
| 19306 | |
| 19307 | L4_MABX_B.SFunction1_o2_n4 = 0.00390625 * ( ((real_T) |
| 19308 | CAN_Sgn.SignedSgn) ); |
| 19309 | |
| 19310 | /* ...... "PX2_MapLaneFarPos" (32|16, standard signal, signed int, little endian) */ |
| 19311 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 19312 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 19313 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19314 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19315 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19316 | } |
| 19317 | |
| 19318 | L4_MABX_B.SFunction1_o3_ot = 0.00390625 * ( ((real_T) |
| 19319 | CAN_Sgn.SignedSgn) ); |
| 19320 | |
| 19321 | /* ...... "PX2_EgoLaneNearPosValid" (48|2, standard signal, unsigned int, little endian) */ |
| 19322 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19323 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19324 | L4_MABX_B.SFunction1_o4_fui = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19325 | |
| 19326 | /* ...... "PX2_EgoLaneMidPosValid" (50|2, standard signal, unsigned int, little endian) */ |
| 19327 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19328 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 19329 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19330 | L4_MABX_B.SFunction1_o5_e = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19331 | |
| 19332 | /* ...... "PX2_EgoLaneFarPosValid" (52|2, standard signal, unsigned int, little endian) */ |
| 19333 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19334 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 19335 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19336 | L4_MABX_B.SFunction1_o6_b = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19337 | } |
| 19338 | } |
| 19339 | } else { |
| 19340 | /* set RX status to 0 because no new message has arrived */ |
| 19341 | L4_MABX_B.SFunction1_o7_b = 0.0; |
| 19342 | } |
| 19343 | } |
| 19344 | } |
| 19345 | |
| 19346 | /* End of Constant: '<S451>/CAN_RX-Enable_PX2_MapLaneEgoLeft' */ |
| 19347 | /* End of Outputs for SubSystem: '<S632>/PX2_MapLaneEgoLeft' */ |
| 19348 | |
| 19349 | /* DataTypeConversion: '<S632>/Data Type Conversion10' */ |
| 19350 | L4_MABX_B.RX_delta_time_la = L4_MABX_B.SFunction1_o9_l; |
| 19351 | |
| 19352 | /* DataTypeConversion: '<S632>/Data Type Conversion8' */ |
| 19353 | L4_MABX_B.RX_status_oa = (L4_MABX_B.SFunction1_o7_b != 0.0); |
| 19354 | |
| 19355 | /* DataTypeConversion: '<S632>/Data Type Conversion9' */ |
| 19356 | L4_MABX_B.RX_time_cx = L4_MABX_B.SFunction1_o8_a1; |
| 19357 | |
| 19358 | /* Outputs for Enabled SubSystem: '<S634>/PX2_MapLaneEgoRight' incorporates: |
| 19359 | * EnablePort: '<S635>/Enable' |
| 19360 | */ |
| 19361 | /* Constant: '<S452>/CAN_RX-Enable_PX2_MapLaneEgoLeft' */ |
| 19362 | if (L4_MABX_P.CAN_RXEnable_PX2_MapLaneEgoLe_e) { |
| 19363 | /* S-Function (rti_commonblock): '<S635>/S-Function1' */ |
| 19364 | /* This comment workarounds a code generation problem */ |
| 19365 | |
| 19366 | /* dSPACE RTICAN RX Message Block: "PX2_MapLaneEgoRight" Id:1541 */ |
| 19367 | { |
| 19368 | UInt32 *CAN_Msg; |
| 19369 | static dsfloat time_old = 0.0; |
| 19370 | |
| 19371 | /* Read status and timestamp info (previous message) */ |
| 19372 | if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x605].timestamp != |
| 19373 | time_old) { |
| 19374 | /* ... save timestamp info for the calculation of the RX status |
| 19375 | during the consecutive sample hit*/ |
| 19376 | time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x605].timestamp; |
| 19377 | |
| 19378 | /* ... set the processed flag to one */ |
| 19379 | L4_MABX_B.SFunction1_o7_ce = 1.0; |
| 19380 | L4_MABX_B.SFunction1_o8_j = (real_T) |
| 19381 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x605].timestamp; |
| 19382 | L4_MABX_B.SFunction1_o9_h = (real_T) |
| 19383 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x605].deltatime; |
| 19384 | CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x605].data; |
| 19385 | |
| 19386 | /* Decode CAN message */ |
| 19387 | { |
| 19388 | { |
| 19389 | rtican_Signal_t CAN_Sgn; |
| 19390 | |
| 19391 | /* ...... "PX2_MapLaneNearPos" (0|16, standard signal, signed int, little endian) */ |
| 19392 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 19393 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 19394 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19395 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19396 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19397 | } |
| 19398 | |
| 19399 | L4_MABX_B.SFunction1_o1_aj = 0.00390625 * ( ((real_T) |
| 19400 | CAN_Sgn.SignedSgn) ); |
| 19401 | |
| 19402 | /* ...... "PX2_MapLaneMidPos" (16|16, standard signal, signed int, little endian) */ |
| 19403 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 19404 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 19405 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19406 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19407 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19408 | } |
| 19409 | |
| 19410 | L4_MABX_B.SFunction1_o2_i = 0.00390625 * ( ((real_T) |
| 19411 | CAN_Sgn.SignedSgn) ); |
| 19412 | |
| 19413 | /* ...... "PX2_MapLaneFarPos" (32|16, standard signal, signed int, little endian) */ |
| 19414 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 19415 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 19416 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19417 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19418 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19419 | } |
| 19420 | |
| 19421 | L4_MABX_B.SFunction1_o3_b4 = 0.00390625 * ( ((real_T) |
| 19422 | CAN_Sgn.SignedSgn) ); |
| 19423 | |
| 19424 | /* ...... "PX2_EgoLaneNearPosValid" (48|2, standard signal, unsigned int, little endian) */ |
| 19425 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19426 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19427 | L4_MABX_B.SFunction1_o4_jz = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19428 | |
| 19429 | /* ...... "PX2_EgoLaneMidPosValid" (50|2, standard signal, unsigned int, little endian) */ |
| 19430 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19431 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 19432 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19433 | L4_MABX_B.SFunction1_o5_a = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19434 | |
| 19435 | /* ...... "PX2_EgoLaneFarPosValid" (52|2, standard signal, unsigned int, little endian) */ |
| 19436 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19437 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 19438 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19439 | L4_MABX_B.SFunction1_o6_d = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19440 | } |
| 19441 | } |
| 19442 | } else { |
| 19443 | /* set RX status to 0 because no new message has arrived */ |
| 19444 | L4_MABX_B.SFunction1_o7_ce = 0.0; |
| 19445 | } |
| 19446 | } |
| 19447 | } |
| 19448 | |
| 19449 | /* End of Constant: '<S452>/CAN_RX-Enable_PX2_MapLaneEgoLeft' */ |
| 19450 | /* End of Outputs for SubSystem: '<S634>/PX2_MapLaneEgoRight' */ |
| 19451 | |
| 19452 | /* DataTypeConversion: '<S634>/Data Type Conversion10' */ |
| 19453 | L4_MABX_B.RX_delta_time_jh = L4_MABX_B.SFunction1_o9_h; |
| 19454 | |
| 19455 | /* DataTypeConversion: '<S634>/Data Type Conversion8' */ |
| 19456 | L4_MABX_B.RX_status_kb = (L4_MABX_B.SFunction1_o7_ce != 0.0); |
| 19457 | |
| 19458 | /* DataTypeConversion: '<S634>/Data Type Conversion9' */ |
| 19459 | L4_MABX_B.RX_time_l2 = L4_MABX_B.SFunction1_o8_j; |
| 19460 | |
| 19461 | /* Outputs for Enabled SubSystem: '<S636>/PX2_EgoLanePos' incorporates: |
| 19462 | * EnablePort: '<S637>/Enable' |
| 19463 | */ |
| 19464 | /* Constant: '<S453>/Constant' */ |
| 19465 | if (L4_MABX_P.Constant_Value_jj) { |
| 19466 | /* S-Function (rti_commonblock): '<S637>/S-Function1' */ |
| 19467 | /* This comment workarounds a code generation problem */ |
| 19468 | |
| 19469 | /* dSPACE RTICAN RX Message Block: "PX2_EgoLanePos" Id:1540 */ |
| 19470 | { |
| 19471 | UInt32 *CAN_Msg; |
| 19472 | static dsfloat time_old = 0.0; |
| 19473 | |
| 19474 | /* Read status and timestamp info (previous message) */ |
| 19475 | if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x604].timestamp != |
| 19476 | time_old) { |
| 19477 | /* ... save timestamp info for the calculation of the RX status |
| 19478 | during the consecutive sample hit*/ |
| 19479 | time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x604].timestamp; |
| 19480 | |
| 19481 | /* ... set the processed flag to one */ |
| 19482 | L4_MABX_B.SFunction1_o7_i = 1.0; |
| 19483 | L4_MABX_B.SFunction1_o8_n = (real_T) |
| 19484 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x604].timestamp; |
| 19485 | L4_MABX_B.SFunction1_o9_o = (real_T) |
| 19486 | can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x604].deltatime; |
| 19487 | CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x604].data; |
| 19488 | |
| 19489 | /* Decode CAN message */ |
| 19490 | { |
| 19491 | { |
| 19492 | rtican_Signal_t CAN_Sgn; |
| 19493 | |
| 19494 | /* ...... "PX2_EgoLaneNearPosErr" (0|16, standard signal, signed int, little endian) */ |
| 19495 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 19496 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1]; |
| 19497 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19498 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19499 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19500 | } |
| 19501 | |
| 19502 | L4_MABX_B.SFunction1_o1_fl = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 19503 | |
| 19504 | /* ...... "PX2_EgoLaneMidPosErr" (16|16, standard signal, signed int, little endian) */ |
| 19505 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 19506 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 19507 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19508 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19509 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19510 | } |
| 19511 | |
| 19512 | L4_MABX_B.SFunction1_o2_a3 = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 19513 | |
| 19514 | /* ...... "PX2_EgoLaneFarPosErr" (32|16, standard signal, signed int, little endian) */ |
| 19515 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 19516 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 19517 | CAN_Sgn.SignedSgn &= 0x0000FFFF; |
| 19518 | if (CAN_Sgn.SignedSgn >> 15) { |
| 19519 | CAN_Sgn.SignedSgn |= 0xFFFF0000; |
| 19520 | } |
| 19521 | |
| 19522 | L4_MABX_B.SFunction1_o3_lx = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) ); |
| 19523 | |
| 19524 | /* ...... "PX2_EgoLaneNearPosValid" (48|2, standard signal, unsigned int, little endian) */ |
| 19525 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19526 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19527 | L4_MABX_B.SFunction1_o4_ox = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19528 | |
| 19529 | /* ...... "PX2_EgoLaneMidPosValid" (50|2, standard signal, unsigned int, little endian) */ |
| 19530 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19531 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2; |
| 19532 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19533 | L4_MABX_B.SFunction1_o5_m = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19534 | |
| 19535 | /* ...... "PX2_EgoLaneFarPosValid" (52|2, standard signal, unsigned int, little endian) */ |
| 19536 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19537 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4; |
| 19538 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 19539 | L4_MABX_B.SFunction1_o6_k = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19540 | } |
| 19541 | } |
| 19542 | } else { |
| 19543 | /* set RX status to 0 because no new message has arrived */ |
| 19544 | L4_MABX_B.SFunction1_o7_i = 0.0; |
| 19545 | } |
| 19546 | } |
| 19547 | } |
| 19548 | |
| 19549 | /* End of Constant: '<S453>/Constant' */ |
| 19550 | /* End of Outputs for SubSystem: '<S636>/PX2_EgoLanePos' */ |
| 19551 | |
| 19552 | /* DataTypeConversion: '<S636>/Data Type Conversion10' */ |
| 19553 | L4_MABX_B.RX_delta_time_pe = L4_MABX_B.SFunction1_o9_o; |
| 19554 | |
| 19555 | /* DataTypeConversion: '<S636>/Data Type Conversion8' */ |
| 19556 | L4_MABX_B.RX_status_je = (L4_MABX_B.SFunction1_o7_i != 0.0); |
| 19557 | |
| 19558 | /* DataTypeConversion: '<S636>/Data Type Conversion9' */ |
| 19559 | L4_MABX_B.RX_time_a5 = L4_MABX_B.SFunction1_o8_n; |
| 19560 | |
| 19561 | /* DataTypeConversion: '<S638>/Data Type Conversion10' */ |
| 19562 | L4_MABX_B.RX_delta_time_ld = L4_MABX_B.SFunction1_o7_m; |
| 19563 | |
| 19564 | /* DataTypeConversion: '<S638>/Data Type Conversion9' */ |
| 19565 | L4_MABX_B.RX_time_n4 = L4_MABX_B.SFunction1_o6_p; |
| 19566 | |
| 19567 | /* DataTypeConversion: '<S640>/Data Type Conversion10' */ |
| 19568 | L4_MABX_B.RX_delta_time_hw = L4_MABX_B.SFunction1_o28; |
| 19569 | |
| 19570 | /* DataTypeConversion: '<S640>/Data Type Conversion8' */ |
| 19571 | L4_MABX_B.RX_status_pj = (L4_MABX_B.SFunction1_o26 != 0.0); |
| 19572 | |
| 19573 | /* DataTypeConversion: '<S640>/Data Type Conversion9' */ |
| 19574 | L4_MABX_B.RX_time_e5 = L4_MABX_B.SFunction1_o27; |
| 19575 | |
| 19576 | /* DataTypeConversion: '<S642>/Data Type Conversion10' */ |
| 19577 | L4_MABX_B.RX_delta_time_o = L4_MABX_B.SFunction1_o10; |
| 19578 | |
| 19579 | /* DataTypeConversion: '<S642>/Data Type Conversion8' */ |
| 19580 | L4_MABX_B.RX_status_dq = (L4_MABX_B.SFunction1_o8_b != 0.0); |
| 19581 | |
| 19582 | /* DataTypeConversion: '<S642>/Data Type Conversion9' */ |
| 19583 | L4_MABX_B.RX_time_k = L4_MABX_B.SFunction1_o9_g; |
| 19584 | |
| 19585 | /* DataTypeConversion: '<S644>/Data Type Conversion10' */ |
| 19586 | L4_MABX_B.RX_delta_time_nn = L4_MABX_B.SFunction1_o9; |
| 19587 | |
| 19588 | /* DataTypeConversion: '<S644>/Data Type Conversion8' */ |
| 19589 | L4_MABX_B.RX_status_ff = (L4_MABX_B.SFunction1_o7_c != 0.0); |
| 19590 | |
| 19591 | /* DataTypeConversion: '<S644>/Data Type Conversion9' */ |
| 19592 | L4_MABX_B.RX_time_h2 = L4_MABX_B.SFunction1_o8_d; |
| 19593 | |
| 19594 | /* Outputs for Enabled SubSystem: '<S646>/VEP1' incorporates: |
| 19595 | * EnablePort: '<S647>/Enable' |
| 19596 | */ |
| 19597 | /* Constant: '<S458>/Constant' */ |
| 19598 | if (L4_MABX_P.Constant_Value_du > 0.0) { |
| 19599 | /* S-Function (rti_commonblock): '<S647>/S-Function1' */ |
| 19600 | /* This comment workarounds a code generation problem */ |
| 19601 | |
| 19602 | /* dSPACE RTICAN RX Message Block: "VEP1" Id:419362563 */ |
| 19603 | { |
| 19604 | UInt32 *CAN_Msg; |
| 19605 | static dsfloat time_old = 0.0; |
| 19606 | |
| 19607 | /* Read status and timestamp info (previous message) */ |
| 19608 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF703].timestamp != |
| 19609 | time_old) { |
| 19610 | /* ... save timestamp info for the calculation of the RX status |
| 19611 | during the consecutive sample hit*/ |
| 19612 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF703]. |
| 19613 | timestamp; |
| 19614 | |
| 19615 | /* ... set the processed flag to one */ |
| 19616 | L4_MABX_B.SFunction1_o6 = 1.0; |
| 19617 | L4_MABX_B.SFunction1_o7 = (real_T) |
| 19618 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF703].timestamp; |
| 19619 | L4_MABX_B.SFunction1_o8 = (real_T) |
| 19620 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF703].deltatime; |
| 19621 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF703].data; |
| 19622 | |
| 19623 | /* Decode CAN message */ |
| 19624 | { |
| 19625 | { |
| 19626 | rtican_Signal_t CAN_Sgn; |
| 19627 | |
| 19628 | /* ...... "NetBatteryCurrent" (0|8, standard signal, unsigned int, little endian) */ |
| 19629 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 19630 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 19631 | L4_MABX_B.SFunction1_o1_n3 = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 19632 | ); |
| 19633 | |
| 19634 | /* ...... "AltCurrent" (8|8, standard signal, unsigned int, little endian) */ |
| 19635 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 19636 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 19637 | L4_MABX_B.SFunction1_o2_on = ((real_T) CAN_Sgn.UnsignedSgn); |
| 19638 | |
| 19639 | /* ...... "ChargingSystemPotential" (16|16, standard signal, unsigned int, little endian) */ |
| 19640 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 19641 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3]; |
| 19642 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 19643 | L4_MABX_B.SFunction1_o3_m4 = 0.05 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 19644 | ); |
| 19645 | |
| 19646 | /* ...... "BatteryPotential_PowerInput1" (32|16, standard signal, unsigned int, little endian) */ |
| 19647 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 19648 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5]; |
| 19649 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 19650 | L4_MABX_B.SFunction1_o4_bg = 0.05 * ( ((real_T) CAN_Sgn.UnsignedSgn) |
| 19651 | ); |
| 19652 | |
| 19653 | /* ...... "KeyswitchBatteryPotential" (48|16, standard signal, unsigned int, little endian) */ |
| 19654 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 19655 | CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[7]; |
| 19656 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 19657 | L4_MABX_B.SFunction1_o5 = 0.05 * ( ((real_T) CAN_Sgn.UnsignedSgn) ); |
| 19658 | } |
| 19659 | } |
| 19660 | } else { |
| 19661 | /* set RX status to 0 because no new message has arrived */ |
| 19662 | L4_MABX_B.SFunction1_o6 = 0.0; |
| 19663 | } |
| 19664 | } |
| 19665 | } |
| 19666 | |
| 19667 | /* End of Constant: '<S458>/Constant' */ |
| 19668 | /* End of Outputs for SubSystem: '<S646>/VEP1' */ |
| 19669 | |
| 19670 | /* DataTypeConversion: '<S646>/Data Type Conversion1' */ |
| 19671 | L4_MABX_B.PitchAngleExRange_j = L4_MABX_B.SFunction1_o1_n3; |
| 19672 | |
| 19673 | /* DataTypeConversion: '<S646>/Data Type Conversion10' */ |
| 19674 | L4_MABX_B.RX_delta_time_p0 = L4_MABX_B.SFunction1_o8; |
| 19675 | |
| 19676 | /* DataTypeConversion: '<S646>/Data Type Conversion2' */ |
| 19677 | L4_MABX_B.AltCurrent = L4_MABX_B.SFunction1_o2_on; |
| 19678 | |
| 19679 | /* DataTypeConversion: '<S646>/Data Type Conversion3' */ |
| 19680 | L4_MABX_B.ChargingSystemPotential = L4_MABX_B.SFunction1_o3_m4; |
| 19681 | |
| 19682 | /* DataTypeConversion: '<S646>/Data Type Conversion4' */ |
| 19683 | L4_MABX_B.BatteryPotential_PowerInput1 = L4_MABX_B.SFunction1_o4_bg; |
| 19684 | |
| 19685 | /* DataTypeConversion: '<S646>/Data Type Conversion5' */ |
| 19686 | L4_MABX_B.KeyswitchBatteryPotential = L4_MABX_B.SFunction1_o5; |
| 19687 | |
| 19688 | /* DataTypeConversion: '<S646>/Data Type Conversion8' */ |
| 19689 | L4_MABX_B.RX_status_e = (L4_MABX_B.SFunction1_o6 != 0.0); |
| 19690 | |
| 19691 | /* DataTypeConversion: '<S646>/Data Type Conversion9' */ |
| 19692 | L4_MABX_B.RX_time_d = L4_MABX_B.SFunction1_o7; |
| 19693 | |
| 19694 | /* RelationalOperator: '<S649>/Relational Operator2' incorporates: |
| 19695 | * Constant: '<S649>/TRUCK_166_VIN_CPV' |
| 19696 | */ |
| 19697 | L4_MABX_B.RelationalOperator2[0] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[0] != |
| 19698 | L4_MABX_B.DataTypeConversion_c4); |
| 19699 | L4_MABX_B.RelationalOperator2[1] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[1] != |
| 19700 | L4_MABX_B.DataTypeConversion1_er); |
| 19701 | L4_MABX_B.RelationalOperator2[2] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[2] != |
| 19702 | L4_MABX_B.DataTypeConversion2_nx); |
| 19703 | L4_MABX_B.RelationalOperator2[3] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[3] != |
| 19704 | L4_MABX_B.DataTypeConversion3_b); |
| 19705 | L4_MABX_B.RelationalOperator2[4] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[4] != |
| 19706 | L4_MABX_B.DataTypeConversion4_d); |
| 19707 | L4_MABX_B.RelationalOperator2[5] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[5] != |
| 19708 | L4_MABX_B.DataTypeConversion5_iu); |
| 19709 | L4_MABX_B.RelationalOperator2[6] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[6] != |
| 19710 | L4_MABX_B.DataTypeConversion6_d); |
| 19711 | L4_MABX_B.RelationalOperator2[7] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[7] != |
| 19712 | L4_MABX_B.DataTypeConversion7_ma); |
| 19713 | L4_MABX_B.RelationalOperator2[8] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[8] != |
| 19714 | L4_MABX_B.DataTypeConversion8_bt); |
| 19715 | L4_MABX_B.RelationalOperator2[9] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[9] != |
| 19716 | L4_MABX_B.DataTypeConversion9_c); |
| 19717 | L4_MABX_B.RelationalOperator2[10] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[10] != |
| 19718 | L4_MABX_B.DataTypeConversion10_b); |
| 19719 | L4_MABX_B.RelationalOperator2[11] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[11] != |
| 19720 | L4_MABX_B.DataTypeConversion11_i); |
| 19721 | L4_MABX_B.RelationalOperator2[12] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[12] != |
| 19722 | L4_MABX_B.DataTypeConversion12); |
| 19723 | L4_MABX_B.RelationalOperator2[13] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[13] != |
| 19724 | L4_MABX_B.DataTypeConversion14_l); |
| 19725 | L4_MABX_B.RelationalOperator2[14] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[14] != |
| 19726 | L4_MABX_B.DataTypeConversion13_k); |
| 19727 | L4_MABX_B.RelationalOperator2[15] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[15] != |
| 19728 | L4_MABX_B.DataTypeConversion15_d); |
| 19729 | L4_MABX_B.RelationalOperator2[16] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[16] != |
| 19730 | L4_MABX_B.DataTypeConversion16_j); |
| 19731 | |
| 19732 | /* Sum: '<S649>/Add1' */ |
| 19733 | tmp = 0U; |
| 19734 | for (i = 0; i < 17; i++) { |
| 19735 | tmp += L4_MABX_B.RelationalOperator2[i]; |
| 19736 | } |
| 19737 | |
| 19738 | L4_MABX_B.Add1_by = (uint8_T)tmp; |
| 19739 | |
| 19740 | /* End of Sum: '<S649>/Add1' */ |
| 19741 | |
| 19742 | /* RelationalOperator: '<S654>/Compare' incorporates: |
| 19743 | * Constant: '<S654>/Constant' |
| 19744 | */ |
| 19745 | L4_MABX_B.Compare_f = (L4_MABX_B.Add1_by == L4_MABX_P.Constant_Value_cj); |
| 19746 | |
| 19747 | /* UnitDelay: '<S649>/Unit_Delay2' */ |
| 19748 | L4_MABX_B.Unit_Delay2_m = L4_MABX_DW.Unit_Delay2_DSTATE_d0; |
| 19749 | |
| 19750 | /* Logic: '<S649>/Logical Operator1' */ |
| 19751 | L4_MABX_B.LogicalOperator1_o = (L4_MABX_B.Unit_Delay2_m && L4_MABX_B.Compare_f); |
| 19752 | |
| 19753 | /* Logic: '<S655>/Logical Operator2' */ |
| 19754 | L4_MABX_B.LogicalOperator2_a = !L4_MABX_B.LogicalOperator1_e; |
| 19755 | |
| 19756 | /* UnitDelay: '<S649>/Unit_Delay1' */ |
| 19757 | L4_MABX_B.Unit_Delay1_l = L4_MABX_DW.Unit_Delay1_DSTATE_d; |
| 19758 | |
| 19759 | /* Logic: '<S656>/Logical Operator3' */ |
| 19760 | L4_MABX_B.LogicalOperator3_a = !L4_MABX_B.Unit_Delay1_l; |
| 19761 | |
| 19762 | /* UnitDelay: '<S656>/Unit_Delay' */ |
| 19763 | L4_MABX_B.Unit_Delay_i = L4_MABX_DW.Unit_Delay_DSTATE_n; |
| 19764 | |
| 19765 | /* Logic: '<S656>/Logical Operator' */ |
| 19766 | L4_MABX_B.LogicalOperator_h = (L4_MABX_B.LogicalOperator3_a && |
| 19767 | L4_MABX_B.Unit_Delay_i); |
| 19768 | |
| 19769 | /* Logic: '<S656>/Logical Operator1' */ |
| 19770 | L4_MABX_B.LogicalOperator1_a = (L4_MABX_B.LogicalOperator1_o || |
| 19771 | L4_MABX_B.LogicalOperator_h); |
| 19772 | |
| 19773 | /* Logic: '<S656>/Logical Operator2' */ |
| 19774 | L4_MABX_B.LogicalOperator2_e = !L4_MABX_B.LogicalOperator1_a; |
| 19775 | |
| 19776 | /* Constant: '<S415>/Constant2' */ |
| 19777 | L4_MABX_B.PX2_HeartBeat = L4_MABX_P.Constant2_Value_c; |
| 19778 | |
| 19779 | /* RelationalOperator: '<S693>/Operator' incorporates: |
| 19780 | * Constant: '<S469>/Constant1' |
| 19781 | */ |
| 19782 | L4_MABX_B.Operator_dr = (L4_MABX_B.DataTypeConversion_jb[0] == |
| 19783 | L4_MABX_P.Constant1_Value_ar); |
| 19784 | |
| 19785 | /* Outputs for Enabled SubSystem: '<S469>/Decode_TPCM_CTS' incorporates: |
| 19786 | * EnablePort: '<S688>/Enable' |
| 19787 | */ |
| 19788 | if (L4_MABX_B.Operator_dr) { |
| 19789 | /* SignalConversion: '<S705>/Signal Conversion' */ |
| 19790 | L4_MABX_B.SPN2556_ControlByte_nl = L4_MABX_B.DataTypeConversion_jb[0]; |
| 19791 | |
| 19792 | /* SignalConversion: '<S706>/Signal Conversion' */ |
| 19793 | L4_MABX_B.SPN2561_NumberOfPacketsThatCanB = L4_MABX_B.DataTypeConversion_jb |
| 19794 | [1]; |
| 19795 | |
| 19796 | /* SignalConversion: '<S707>/Signal Conversion' */ |
| 19797 | L4_MABX_B.SPN2562_NextPacketNumberToBeSen = L4_MABX_B.DataTypeConversion_jb |
| 19798 | [2]; |
| 19799 | |
| 19800 | /* DataTypeConversion: '<S708>/Data Type Conversion' */ |
| 19801 | L4_MABX_B.DataTypeConversion_ez = L4_MABX_B.DataTypeConversion_jb[5]; |
| 19802 | |
| 19803 | /* DataTypeConversion: '<S708>/Data Type Conversion1' */ |
| 19804 | L4_MABX_B.DataTypeConversion1_et = L4_MABX_B.DataTypeConversion_jb[6]; |
| 19805 | |
| 19806 | /* DataTypeConversion: '<S708>/Data Type Conversion2' */ |
| 19807 | L4_MABX_B.DataTypeConversion2_fg = L4_MABX_B.DataTypeConversion_jb[7]; |
| 19808 | |
| 19809 | /* ArithShift: '<S708>/Shift Arithmetic1' */ |
| 19810 | L4_MABX_B.ShiftArithmetic1_a = L4_MABX_B.DataTypeConversion1_et << 8; |
| 19811 | |
| 19812 | /* ArithShift: '<S708>/Shift Arithmetic2' */ |
| 19813 | L4_MABX_B.ShiftArithmetic2_l = L4_MABX_B.DataTypeConversion2_fg << 16; |
| 19814 | |
| 19815 | /* S-Function (sfix_bitop): '<S709>/Operator' */ |
| 19816 | L4_MABX_B.Operator_e = L4_MABX_B.DataTypeConversion_ez | |
| 19817 | L4_MABX_B.ShiftArithmetic1_a | L4_MABX_B.ShiftArithmetic2_l; |
| 19818 | |
| 19819 | /* DataTypeConversion: '<S709>/DataType' */ |
| 19820 | L4_MABX_B.DataType_kr = L4_MABX_B.Operator_e; |
| 19821 | } |
| 19822 | |
| 19823 | /* End of Outputs for SubSystem: '<S469>/Decode_TPCM_CTS' */ |
| 19824 | |
| 19825 | /* RelationalOperator: '<S696>/Operator' incorporates: |
| 19826 | * Constant: '<S469>/Constant4' |
| 19827 | */ |
| 19828 | L4_MABX_B.Operator_m3 = (L4_MABX_B.DataTypeConversion_jb[0] == |
| 19829 | L4_MABX_P.Constant4_Value_bu); |
| 19830 | |
| 19831 | /* Outputs for Enabled SubSystem: '<S469>/Decode_TPCM_ConnectionAbort' incorporates: |
| 19832 | * EnablePort: '<S689>/Enable' |
| 19833 | */ |
| 19834 | if (L4_MABX_B.Operator_m3) { |
| 19835 | /* SignalConversion: '<S711>/Signal Conversion' */ |
| 19836 | L4_MABX_B.SPN2556_ControlByte_f = L4_MABX_B.DataTypeConversion_jb[0]; |
| 19837 | |
| 19838 | /* SignalConversion: '<S712>/Signal Conversion' */ |
| 19839 | L4_MABX_B.SPN2570_ConnectionAbortReason = L4_MABX_B.DataTypeConversion_jb[1]; |
| 19840 | |
| 19841 | /* DataTypeConversion: '<S713>/Data Type Conversion' */ |
| 19842 | L4_MABX_B.DataTypeConversion_g = L4_MABX_B.DataTypeConversion_jb[5]; |
| 19843 | |
| 19844 | /* DataTypeConversion: '<S713>/Data Type Conversion1' */ |
| 19845 | L4_MABX_B.DataTypeConversion1_fo = L4_MABX_B.DataTypeConversion_jb[6]; |
| 19846 | |
| 19847 | /* DataTypeConversion: '<S713>/Data Type Conversion2' */ |
| 19848 | L4_MABX_B.DataTypeConversion2_h = L4_MABX_B.DataTypeConversion_jb[7]; |
| 19849 | |
| 19850 | /* ArithShift: '<S713>/Shift Arithmetic1' */ |
| 19851 | L4_MABX_B.ShiftArithmetic1_k = L4_MABX_B.DataTypeConversion1_fo << 8; |
| 19852 | |
| 19853 | /* ArithShift: '<S713>/Shift Arithmetic2' */ |
| 19854 | L4_MABX_B.ShiftArithmetic2_c = L4_MABX_B.DataTypeConversion2_h << 16; |
| 19855 | |
| 19856 | /* S-Function (sfix_bitop): '<S714>/Operator' */ |
| 19857 | L4_MABX_B.Operator_f = L4_MABX_B.DataTypeConversion_g | |
| 19858 | L4_MABX_B.ShiftArithmetic1_k | L4_MABX_B.ShiftArithmetic2_c; |
| 19859 | |
| 19860 | /* DataTypeConversion: '<S714>/DataType' */ |
| 19861 | L4_MABX_B.DataType_o0 = L4_MABX_B.Operator_f; |
| 19862 | } |
| 19863 | |
| 19864 | /* End of Outputs for SubSystem: '<S469>/Decode_TPCM_ConnectionAbort' */ |
| 19865 | |
| 19866 | /* RelationalOperator: '<S694>/Operator' incorporates: |
| 19867 | * Constant: '<S469>/Constant2' |
| 19868 | */ |
| 19869 | L4_MABX_B.Operator_ck = (L4_MABX_B.DataTypeConversion_jb[0] == |
| 19870 | L4_MABX_P.Constant2_Value_b3); |
| 19871 | |
| 19872 | /* Outputs for Enabled SubSystem: '<S469>/Decode_TPCM_EndOfMessageAck' incorporates: |
| 19873 | * EnablePort: '<S690>/Enable' |
| 19874 | */ |
| 19875 | if (L4_MABX_B.Operator_ck) { |
| 19876 | /* SignalConversion: '<S716>/Signal Conversion' */ |
| 19877 | L4_MABX_B.SPN2556_ControlByte_n = L4_MABX_B.DataTypeConversion_jb[0]; |
| 19878 | |
| 19879 | /* DataTypeConversion: '<S717>/Data Type Conversion' */ |
| 19880 | L4_MABX_B.DataTypeConversion_ac = L4_MABX_B.DataTypeConversion_jb[1]; |
| 19881 | |
| 19882 | /* DataTypeConversion: '<S717>/Data Type Conversion1' */ |
| 19883 | L4_MABX_B.DataTypeConversion1_nl = L4_MABX_B.DataTypeConversion_jb[2]; |
| 19884 | |
| 19885 | /* ArithShift: '<S717>/Shift Arithmetic2' */ |
| 19886 | L4_MABX_B.ShiftArithmetic2_o = (uint16_T)(L4_MABX_B.DataTypeConversion1_nl << |
| 19887 | 8); |
| 19888 | |
| 19889 | /* S-Function (sfix_bitop): '<S720>/Operator' */ |
| 19890 | L4_MABX_B.Operator_ld = (uint16_T)(L4_MABX_B.DataTypeConversion_ac | |
| 19891 | L4_MABX_B.ShiftArithmetic2_o); |
| 19892 | |
| 19893 | /* DataTypeConversion: '<S720>/DataType' */ |
| 19894 | L4_MABX_B.DataType_oo = L4_MABX_B.Operator_ld; |
| 19895 | |
| 19896 | /* SignalConversion: '<S718>/Signal Conversion' */ |
| 19897 | L4_MABX_B.SPN2565_TotalNumberOfPackets = L4_MABX_B.DataTypeConversion_jb[3]; |
| 19898 | |
| 19899 | /* DataTypeConversion: '<S719>/Data Type Conversion' */ |
| 19900 | L4_MABX_B.DataTypeConversion_e = L4_MABX_B.DataTypeConversion_jb[5]; |
| 19901 | |
| 19902 | /* DataTypeConversion: '<S719>/Data Type Conversion1' */ |
| 19903 | L4_MABX_B.DataTypeConversion1_pw = L4_MABX_B.DataTypeConversion_jb[6]; |
| 19904 | |
| 19905 | /* DataTypeConversion: '<S719>/Data Type Conversion2' */ |
| 19906 | L4_MABX_B.DataTypeConversion2_cc = L4_MABX_B.DataTypeConversion_jb[7]; |
| 19907 | |
| 19908 | /* ArithShift: '<S719>/Shift Arithmetic1' */ |
| 19909 | L4_MABX_B.ShiftArithmetic1_m = L4_MABX_B.DataTypeConversion1_pw << 8; |
| 19910 | |
| 19911 | /* ArithShift: '<S719>/Shift Arithmetic2' */ |
| 19912 | L4_MABX_B.ShiftArithmetic2_m = L4_MABX_B.DataTypeConversion2_cc << 16; |
| 19913 | |
| 19914 | /* S-Function (sfix_bitop): '<S721>/Operator' */ |
| 19915 | L4_MABX_B.Operator_kh = L4_MABX_B.DataTypeConversion_e | |
| 19916 | L4_MABX_B.ShiftArithmetic1_m | L4_MABX_B.ShiftArithmetic2_m; |
| 19917 | |
| 19918 | /* DataTypeConversion: '<S721>/DataType' */ |
| 19919 | L4_MABX_B.DataType_m00 = L4_MABX_B.Operator_kh; |
| 19920 | } |
| 19921 | |
| 19922 | /* End of Outputs for SubSystem: '<S469>/Decode_TPCM_EndOfMessageAck' */ |
| 19923 | |
| 19924 | /* RelationalOperator: '<S692>/Operator' incorporates: |
| 19925 | * Constant: '<S469>/Constant' |
| 19926 | */ |
| 19927 | L4_MABX_B.Operator_me = (L4_MABX_B.DataTypeConversion_jb[0] == |
| 19928 | L4_MABX_P.Constant_Value_k2); |
| 19929 | |
| 19930 | /* Outputs for Enabled SubSystem: '<S469>/Decode_TPCM_RTS' incorporates: |
| 19931 | * EnablePort: '<S691>/Enable' |
| 19932 | */ |
| 19933 | if (L4_MABX_B.Operator_me) { |
| 19934 | /* SignalConversion: '<S723>/Signal Conversion' */ |
| 19935 | L4_MABX_B.SPN2556_ControlByte = L4_MABX_B.DataTypeConversion_jb[0]; |
| 19936 | |
| 19937 | /* DataTypeConversion: '<S724>/Data Type Conversion' */ |
| 19938 | L4_MABX_B.DataTypeConversion_ay = L4_MABX_B.DataTypeConversion_jb[1]; |
| 19939 | |
| 19940 | /* DataTypeConversion: '<S724>/Data Type Conversion1' */ |
| 19941 | L4_MABX_B.DataTypeConversion1_he = L4_MABX_B.DataTypeConversion_jb[2]; |
| 19942 | |
| 19943 | /* ArithShift: '<S724>/Shift Arithmetic2' */ |
| 19944 | L4_MABX_B.ShiftArithmetic2_ki = (uint16_T)(L4_MABX_B.DataTypeConversion1_he << |
| 19945 | 8); |
| 19946 | |
| 19947 | /* S-Function (sfix_bitop): '<S728>/Operator' */ |
| 19948 | L4_MABX_B.Operator_o4 = (uint16_T)(L4_MABX_B.DataTypeConversion_ay | |
| 19949 | L4_MABX_B.ShiftArithmetic2_ki); |
| 19950 | |
| 19951 | /* DataTypeConversion: '<S728>/DataType' */ |
| 19952 | L4_MABX_B.DataType_p5 = L4_MABX_B.Operator_o4; |
| 19953 | |
| 19954 | /* SignalConversion: '<S725>/Signal Conversion' */ |
| 19955 | L4_MABX_B.SPN2558_TotalNumberOfPackets = L4_MABX_B.DataTypeConversion_jb[3]; |
| 19956 | |
| 19957 | /* SignalConversion: '<S726>/Signal Conversion' */ |
| 19958 | L4_MABX_B.SPN2559_MaximumNumberOfPackets = L4_MABX_B.DataTypeConversion_jb[4]; |
| 19959 | |
| 19960 | /* DataTypeConversion: '<S727>/Data Type Conversion' */ |
| 19961 | L4_MABX_B.DataTypeConversion_cx = L4_MABX_B.DataTypeConversion_jb[5]; |
| 19962 | |
| 19963 | /* DataTypeConversion: '<S727>/Data Type Conversion1' */ |
| 19964 | L4_MABX_B.DataTypeConversion1_bec = L4_MABX_B.DataTypeConversion_jb[6]; |
| 19965 | |
| 19966 | /* DataTypeConversion: '<S727>/Data Type Conversion2' */ |
| 19967 | L4_MABX_B.DataTypeConversion2_ld = L4_MABX_B.DataTypeConversion_jb[7]; |
| 19968 | |
| 19969 | /* ArithShift: '<S727>/Shift Arithmetic1' */ |
| 19970 | L4_MABX_B.ShiftArithmetic1 = L4_MABX_B.DataTypeConversion1_bec << 8; |
| 19971 | |
| 19972 | /* ArithShift: '<S727>/Shift Arithmetic2' */ |
| 19973 | L4_MABX_B.ShiftArithmetic2 = L4_MABX_B.DataTypeConversion2_ld << 16; |
| 19974 | |
| 19975 | /* S-Function (sfix_bitop): '<S729>/Operator' */ |
| 19976 | L4_MABX_B.Operator_kr = L4_MABX_B.DataTypeConversion_cx | |
| 19977 | L4_MABX_B.ShiftArithmetic1 | L4_MABX_B.ShiftArithmetic2; |
| 19978 | |
| 19979 | /* DataTypeConversion: '<S729>/DataType' */ |
| 19980 | L4_MABX_B.DataType_o3 = L4_MABX_B.Operator_kr; |
| 19981 | } |
| 19982 | |
| 19983 | /* End of Outputs for SubSystem: '<S469>/Decode_TPCM_RTS' */ |
| 19984 | |
| 19985 | /* RelationalOperator: '<S589>/Operator' incorporates: |
| 19986 | * Constant: '<S444>/Constant' |
| 19987 | * Constant: '<S585>/Constant' |
| 19988 | */ |
| 19989 | L4_MABX_B.Operator_oqh = (PROPB_REAX_CHANNEL_APV == |
| 19990 | L4_MABX_P.Constant_Value_pa); |
| 19991 | |
| 19992 | /* Outputs for Enabled SubSystem: '<S582>/CAN_TYPE1_RX_M1_C1' incorporates: |
| 19993 | * EnablePort: '<S586>/Enable' |
| 19994 | */ |
| 19995 | if (L4_MABX_B.Operator_oqh) { |
| 19996 | /* S-Function (rti_commonblock): '<S586>/S-Function1' */ |
| 19997 | /* This comment workarounds a code generation problem */ |
| 19998 | |
| 19999 | /* dSPACE RTICAN RX Message Block: "PropB_REAX_3_13" Id:419426579 */ |
| 20000 | { |
| 20001 | UInt32 *CAN_Msg; |
| 20002 | static dsfloat time_old = 0.0; |
| 20003 | |
| 20004 | /* Read status and timestamp info (previous message) */ |
| 20005 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF113].timestamp != |
| 20006 | time_old) { |
| 20007 | /* ... save timestamp info for the calculation of the RX status |
| 20008 | during the consecutive sample hit*/ |
| 20009 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF113]. |
| 20010 | timestamp; |
| 20011 | |
| 20012 | /* ... set the processed flag to one */ |
| 20013 | L4_MABX_B.SFunction1_o9_hj = 1.0; |
| 20014 | L4_MABX_B.SFunction1_o10_n5 = (real_T) |
| 20015 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF113].timestamp; |
| 20016 | L4_MABX_B.SFunction1_o11_e = (real_T) |
| 20017 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF113].deltatime; |
| 20018 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF113].data; |
| 20019 | |
| 20020 | /* Decode CAN message */ |
| 20021 | { |
| 20022 | { |
| 20023 | rtican_Signal_t CAN_Sgn; |
| 20024 | |
| 20025 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 20026 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 20027 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20028 | L4_MABX_B.SFunction1_o1_ma = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20029 | |
| 20030 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 20031 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 20032 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20033 | L4_MABX_B.SFunction1_o2_k4 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20034 | |
| 20035 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 20036 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 20037 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20038 | L4_MABX_B.SFunction1_o3_p4z = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20039 | |
| 20040 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 20041 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 20042 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20043 | L4_MABX_B.SFunction1_o4_b3 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20044 | |
| 20045 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 20046 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 20047 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20048 | L4_MABX_B.SFunction1_o5_bb = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20049 | |
| 20050 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 20051 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 20052 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20053 | L4_MABX_B.SFunction1_o6_f = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20054 | |
| 20055 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 20056 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 20057 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20058 | L4_MABX_B.SFunction1_o7_kh = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20059 | |
| 20060 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 20061 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 20062 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20063 | L4_MABX_B.SFunction1_o8_od = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20064 | } |
| 20065 | } |
| 20066 | } else { |
| 20067 | /* set RX status to 0 because no new message has arrived */ |
| 20068 | L4_MABX_B.SFunction1_o9_hj = 0.0; |
| 20069 | } |
| 20070 | } |
| 20071 | } |
| 20072 | |
| 20073 | /* End of Outputs for SubSystem: '<S582>/CAN_TYPE1_RX_M1_C1' */ |
| 20074 | |
| 20075 | /* RelationalOperator: '<S590>/Operator' incorporates: |
| 20076 | * Constant: '<S444>/Constant' |
| 20077 | * Constant: '<S585>/Constant1' |
| 20078 | */ |
| 20079 | L4_MABX_B.Operator_ii = (PROPB_REAX_CHANNEL_APV == |
| 20080 | L4_MABX_P.Constant1_Value_end); |
| 20081 | |
| 20082 | /* Outputs for Enabled SubSystem: '<S583>/CAN_TYPE1_RX_M1_C2' incorporates: |
| 20083 | * EnablePort: '<S587>/Enable' |
| 20084 | */ |
| 20085 | if (L4_MABX_B.Operator_ii) { |
| 20086 | /* S-Function (rti_commonblock): '<S587>/S-Function1' */ |
| 20087 | /* This comment workarounds a code generation problem */ |
| 20088 | |
| 20089 | /* dSPACE RTICAN RX Message Block: "PropB_REAX_3_13" Id:419426579 */ |
| 20090 | { |
| 20091 | UInt32 *CAN_Msg; |
| 20092 | static dsfloat time_old = 0.0; |
| 20093 | |
| 20094 | /* Read status and timestamp info (previous message) */ |
| 20095 | if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF113].timestamp != |
| 20096 | time_old) { |
| 20097 | /* ... save timestamp info for the calculation of the RX status |
| 20098 | during the consecutive sample hit*/ |
| 20099 | time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF113]. |
| 20100 | timestamp; |
| 20101 | |
| 20102 | /* ... set the processed flag to one */ |
| 20103 | L4_MABX_B.SFunction1_o9_j = 1.0; |
| 20104 | L4_MABX_B.SFunction1_o10_ay = (real_T) |
| 20105 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF113].timestamp; |
| 20106 | L4_MABX_B.SFunction1_o11_om = (real_T) |
| 20107 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF113].deltatime; |
| 20108 | CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF113].data; |
| 20109 | |
| 20110 | /* Decode CAN message */ |
| 20111 | { |
| 20112 | { |
| 20113 | rtican_Signal_t CAN_Sgn; |
| 20114 | |
| 20115 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 20116 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 20117 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20118 | L4_MABX_B.SFunction1_o1_ef = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20119 | |
| 20120 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 20121 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 20122 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20123 | L4_MABX_B.SFunction1_o2_ono = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20124 | |
| 20125 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 20126 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 20127 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20128 | L4_MABX_B.SFunction1_o3_pu = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20129 | |
| 20130 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 20131 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 20132 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20133 | L4_MABX_B.SFunction1_o4_ex = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20134 | |
| 20135 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 20136 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 20137 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20138 | L4_MABX_B.SFunction1_o5_og = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20139 | |
| 20140 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 20141 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 20142 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20143 | L4_MABX_B.SFunction1_o6_j = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20144 | |
| 20145 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 20146 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 20147 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20148 | L4_MABX_B.SFunction1_o7_oj = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20149 | |
| 20150 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 20151 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 20152 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20153 | L4_MABX_B.SFunction1_o8_l = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20154 | } |
| 20155 | } |
| 20156 | } else { |
| 20157 | /* set RX status to 0 because no new message has arrived */ |
| 20158 | L4_MABX_B.SFunction1_o9_j = 0.0; |
| 20159 | } |
| 20160 | } |
| 20161 | } |
| 20162 | |
| 20163 | /* End of Outputs for SubSystem: '<S583>/CAN_TYPE1_RX_M1_C2' */ |
| 20164 | |
| 20165 | /* DataTypeConversion: '<S583>/Data Type Conversion' */ |
| 20166 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_ef; |
| 20167 | if (PositionFinalLimited < 256.0) { |
| 20168 | if (PositionFinalLimited >= 0.0) { |
| 20169 | starting_index = (uint8_T)PositionFinalLimited; |
| 20170 | } else { |
| 20171 | starting_index = 0U; |
| 20172 | } |
| 20173 | } else { |
| 20174 | starting_index = MAX_uint8_T; |
| 20175 | } |
| 20176 | |
| 20177 | L4_MABX_B.DataTypeConversion_a3 = starting_index; |
| 20178 | |
| 20179 | /* End of DataTypeConversion: '<S583>/Data Type Conversion' */ |
| 20180 | |
| 20181 | /* DataTypeConversion: '<S583>/Data Type Conversion1' */ |
| 20182 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_ono; |
| 20183 | if (PositionFinalLimited < 256.0) { |
| 20184 | if (PositionFinalLimited >= 0.0) { |
| 20185 | starting_index = (uint8_T)PositionFinalLimited; |
| 20186 | } else { |
| 20187 | starting_index = 0U; |
| 20188 | } |
| 20189 | } else { |
| 20190 | starting_index = MAX_uint8_T; |
| 20191 | } |
| 20192 | |
| 20193 | L4_MABX_B.DataTypeConversion1_ay = starting_index; |
| 20194 | |
| 20195 | /* End of DataTypeConversion: '<S583>/Data Type Conversion1' */ |
| 20196 | |
| 20197 | /* DataTypeConversion: '<S583>/Data Type Conversion2' */ |
| 20198 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_pu; |
| 20199 | if (PositionFinalLimited < 256.0) { |
| 20200 | if (PositionFinalLimited >= 0.0) { |
| 20201 | starting_index = (uint8_T)PositionFinalLimited; |
| 20202 | } else { |
| 20203 | starting_index = 0U; |
| 20204 | } |
| 20205 | } else { |
| 20206 | starting_index = MAX_uint8_T; |
| 20207 | } |
| 20208 | |
| 20209 | L4_MABX_B.DataTypeConversion2_o5 = starting_index; |
| 20210 | |
| 20211 | /* End of DataTypeConversion: '<S583>/Data Type Conversion2' */ |
| 20212 | |
| 20213 | /* DataTypeConversion: '<S583>/Data Type Conversion3' */ |
| 20214 | PositionFinalLimited = L4_MABX_B.SFunction1_o4_ex; |
| 20215 | if (PositionFinalLimited < 256.0) { |
| 20216 | if (PositionFinalLimited >= 0.0) { |
| 20217 | starting_index = (uint8_T)PositionFinalLimited; |
| 20218 | } else { |
| 20219 | starting_index = 0U; |
| 20220 | } |
| 20221 | } else { |
| 20222 | starting_index = MAX_uint8_T; |
| 20223 | } |
| 20224 | |
| 20225 | L4_MABX_B.DataTypeConversion3_nb = starting_index; |
| 20226 | |
| 20227 | /* End of DataTypeConversion: '<S583>/Data Type Conversion3' */ |
| 20228 | |
| 20229 | /* DataTypeConversion: '<S583>/Data Type Conversion4' */ |
| 20230 | PositionFinalLimited = L4_MABX_B.SFunction1_o5_og; |
| 20231 | if (PositionFinalLimited < 256.0) { |
| 20232 | if (PositionFinalLimited >= 0.0) { |
| 20233 | starting_index = (uint8_T)PositionFinalLimited; |
| 20234 | } else { |
| 20235 | starting_index = 0U; |
| 20236 | } |
| 20237 | } else { |
| 20238 | starting_index = MAX_uint8_T; |
| 20239 | } |
| 20240 | |
| 20241 | L4_MABX_B.DataTypeConversion4_bn = starting_index; |
| 20242 | |
| 20243 | /* End of DataTypeConversion: '<S583>/Data Type Conversion4' */ |
| 20244 | |
| 20245 | /* DataTypeConversion: '<S583>/Data Type Conversion5' */ |
| 20246 | PositionFinalLimited = L4_MABX_B.SFunction1_o6_j; |
| 20247 | if (PositionFinalLimited < 256.0) { |
| 20248 | if (PositionFinalLimited >= 0.0) { |
| 20249 | starting_index = (uint8_T)PositionFinalLimited; |
| 20250 | } else { |
| 20251 | starting_index = 0U; |
| 20252 | } |
| 20253 | } else { |
| 20254 | starting_index = MAX_uint8_T; |
| 20255 | } |
| 20256 | |
| 20257 | L4_MABX_B.DataTypeConversion5_ke = starting_index; |
| 20258 | |
| 20259 | /* End of DataTypeConversion: '<S583>/Data Type Conversion5' */ |
| 20260 | |
| 20261 | /* DataTypeConversion: '<S583>/Data Type Conversion6' */ |
| 20262 | PositionFinalLimited = L4_MABX_B.SFunction1_o7_oj; |
| 20263 | if (PositionFinalLimited < 256.0) { |
| 20264 | if (PositionFinalLimited >= 0.0) { |
| 20265 | starting_index = (uint8_T)PositionFinalLimited; |
| 20266 | } else { |
| 20267 | starting_index = 0U; |
| 20268 | } |
| 20269 | } else { |
| 20270 | starting_index = MAX_uint8_T; |
| 20271 | } |
| 20272 | |
| 20273 | L4_MABX_B.DataTypeConversion6_g = starting_index; |
| 20274 | |
| 20275 | /* End of DataTypeConversion: '<S583>/Data Type Conversion6' */ |
| 20276 | |
| 20277 | /* DataTypeConversion: '<S583>/Data Type Conversion7' */ |
| 20278 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_l; |
| 20279 | if (PositionFinalLimited < 256.0) { |
| 20280 | if (PositionFinalLimited >= 0.0) { |
| 20281 | starting_index = (uint8_T)PositionFinalLimited; |
| 20282 | } else { |
| 20283 | starting_index = 0U; |
| 20284 | } |
| 20285 | } else { |
| 20286 | starting_index = MAX_uint8_T; |
| 20287 | } |
| 20288 | |
| 20289 | L4_MABX_B.DataTypeConversion7_d = starting_index; |
| 20290 | |
| 20291 | /* End of DataTypeConversion: '<S583>/Data Type Conversion7' */ |
| 20292 | |
| 20293 | /* RelationalOperator: '<S594>/Operator' incorporates: |
| 20294 | * Constant: '<S444>/Constant' |
| 20295 | * Constant: '<S585>/Constant5' |
| 20296 | */ |
| 20297 | L4_MABX_B.Operator_gh = (PROPB_REAX_CHANNEL_APV == |
| 20298 | L4_MABX_P.Constant5_Value_fs); |
| 20299 | |
| 20300 | /* Outputs for Enabled SubSystem: '<S584>/CAN_TYPE1_RX_M3_C2' incorporates: |
| 20301 | * EnablePort: '<S588>/Enable' |
| 20302 | */ |
| 20303 | if (L4_MABX_B.Operator_gh) { |
| 20304 | /* S-Function (rti_commonblock): '<S588>/S-Function1' */ |
| 20305 | /* This comment workarounds a code generation problem */ |
| 20306 | |
| 20307 | /* dSPACE RTICAN RX Message Block: "PropB_REAX_3_13" Id:486535443 */ |
| 20308 | { |
| 20309 | UInt32 *CAN_Msg; |
| 20310 | static dsfloat time_old = 0.0; |
| 20311 | |
| 20312 | /* Read status and timestamp info (previous message) */ |
| 20313 | if (can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF113].timestamp != |
| 20314 | time_old) { |
| 20315 | /* ... save timestamp info for the calculation of the RX status |
| 20316 | during the consecutive sample hit*/ |
| 20317 | time_old = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF113]. |
| 20318 | timestamp; |
| 20319 | |
| 20320 | /* ... set the processed flag to one */ |
| 20321 | L4_MABX_B.SFunction1_o9_b = 1.0; |
| 20322 | L4_MABX_B.SFunction1_o10_k = (real_T) |
| 20323 | can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF113].timestamp; |
| 20324 | L4_MABX_B.SFunction1_o11_kc = (real_T) |
| 20325 | can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF113].deltatime; |
| 20326 | CAN_Msg = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF113].data; |
| 20327 | |
| 20328 | /* Decode CAN message */ |
| 20329 | { |
| 20330 | { |
| 20331 | rtican_Signal_t CAN_Sgn; |
| 20332 | |
| 20333 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 20334 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 20335 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20336 | L4_MABX_B.SFunction1_o1_bn = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20337 | |
| 20338 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 20339 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 20340 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20341 | L4_MABX_B.SFunction1_o2_mn = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20342 | |
| 20343 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 20344 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 20345 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20346 | L4_MABX_B.SFunction1_o3_aj = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20347 | |
| 20348 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 20349 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 20350 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20351 | L4_MABX_B.SFunction1_o4_kp = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20352 | |
| 20353 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 20354 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 20355 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20356 | L4_MABX_B.SFunction1_o5_nb = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20357 | |
| 20358 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 20359 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 20360 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20361 | L4_MABX_B.SFunction1_o6_g = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20362 | |
| 20363 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 20364 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 20365 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20366 | L4_MABX_B.SFunction1_o7_of = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20367 | |
| 20368 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 20369 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 20370 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 20371 | L4_MABX_B.SFunction1_o8_ah = ((real_T) CAN_Sgn.UnsignedSgn); |
| 20372 | } |
| 20373 | } |
| 20374 | } else { |
| 20375 | /* set RX status to 0 because no new message has arrived */ |
| 20376 | L4_MABX_B.SFunction1_o9_b = 0.0; |
| 20377 | } |
| 20378 | } |
| 20379 | } |
| 20380 | |
| 20381 | /* End of Outputs for SubSystem: '<S584>/CAN_TYPE1_RX_M3_C2' */ |
| 20382 | |
| 20383 | /* DataTypeConversion: '<S584>/Data Type Conversion' */ |
| 20384 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_bn; |
| 20385 | if (PositionFinalLimited < 256.0) { |
| 20386 | if (PositionFinalLimited >= 0.0) { |
| 20387 | starting_index = (uint8_T)PositionFinalLimited; |
| 20388 | } else { |
| 20389 | starting_index = 0U; |
| 20390 | } |
| 20391 | } else { |
| 20392 | starting_index = MAX_uint8_T; |
| 20393 | } |
| 20394 | |
| 20395 | L4_MABX_B.DataTypeConversion_om = starting_index; |
| 20396 | |
| 20397 | /* End of DataTypeConversion: '<S584>/Data Type Conversion' */ |
| 20398 | |
| 20399 | /* DataTypeConversion: '<S584>/Data Type Conversion1' */ |
| 20400 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_mn; |
| 20401 | if (PositionFinalLimited < 256.0) { |
| 20402 | if (PositionFinalLimited >= 0.0) { |
| 20403 | starting_index = (uint8_T)PositionFinalLimited; |
| 20404 | } else { |
| 20405 | starting_index = 0U; |
| 20406 | } |
| 20407 | } else { |
| 20408 | starting_index = MAX_uint8_T; |
| 20409 | } |
| 20410 | |
| 20411 | L4_MABX_B.DataTypeConversion1_a2 = starting_index; |
| 20412 | |
| 20413 | /* End of DataTypeConversion: '<S584>/Data Type Conversion1' */ |
| 20414 | |
| 20415 | /* DataTypeConversion: '<S584>/Data Type Conversion2' */ |
| 20416 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_aj; |
| 20417 | if (PositionFinalLimited < 256.0) { |
| 20418 | if (PositionFinalLimited >= 0.0) { |
| 20419 | starting_index = (uint8_T)PositionFinalLimited; |
| 20420 | } else { |
| 20421 | starting_index = 0U; |
| 20422 | } |
| 20423 | } else { |
| 20424 | starting_index = MAX_uint8_T; |
| 20425 | } |
| 20426 | |
| 20427 | L4_MABX_B.DataTypeConversion2_p2 = starting_index; |
| 20428 | |
| 20429 | /* End of DataTypeConversion: '<S584>/Data Type Conversion2' */ |
| 20430 | |
| 20431 | /* DataTypeConversion: '<S584>/Data Type Conversion3' */ |
| 20432 | PositionFinalLimited = L4_MABX_B.SFunction1_o4_kp; |
| 20433 | if (PositionFinalLimited < 256.0) { |
| 20434 | if (PositionFinalLimited >= 0.0) { |
| 20435 | starting_index = (uint8_T)PositionFinalLimited; |
| 20436 | } else { |
| 20437 | starting_index = 0U; |
| 20438 | } |
| 20439 | } else { |
| 20440 | starting_index = MAX_uint8_T; |
| 20441 | } |
| 20442 | |
| 20443 | L4_MABX_B.DataTypeConversion3_bh = starting_index; |
| 20444 | |
| 20445 | /* End of DataTypeConversion: '<S584>/Data Type Conversion3' */ |
| 20446 | |
| 20447 | /* DataTypeConversion: '<S584>/Data Type Conversion4' */ |
| 20448 | PositionFinalLimited = L4_MABX_B.SFunction1_o5_nb; |
| 20449 | if (PositionFinalLimited < 256.0) { |
| 20450 | if (PositionFinalLimited >= 0.0) { |
| 20451 | starting_index = (uint8_T)PositionFinalLimited; |
| 20452 | } else { |
| 20453 | starting_index = 0U; |
| 20454 | } |
| 20455 | } else { |
| 20456 | starting_index = MAX_uint8_T; |
| 20457 | } |
| 20458 | |
| 20459 | L4_MABX_B.DataTypeConversion4_ic = starting_index; |
| 20460 | |
| 20461 | /* End of DataTypeConversion: '<S584>/Data Type Conversion4' */ |
| 20462 | |
| 20463 | /* DataTypeConversion: '<S584>/Data Type Conversion5' */ |
| 20464 | PositionFinalLimited = L4_MABX_B.SFunction1_o6_g; |
| 20465 | if (PositionFinalLimited < 256.0) { |
| 20466 | if (PositionFinalLimited >= 0.0) { |
| 20467 | starting_index = (uint8_T)PositionFinalLimited; |
| 20468 | } else { |
| 20469 | starting_index = 0U; |
| 20470 | } |
| 20471 | } else { |
| 20472 | starting_index = MAX_uint8_T; |
| 20473 | } |
| 20474 | |
| 20475 | L4_MABX_B.DataTypeConversion5_kt = starting_index; |
| 20476 | |
| 20477 | /* End of DataTypeConversion: '<S584>/Data Type Conversion5' */ |
| 20478 | |
| 20479 | /* DataTypeConversion: '<S584>/Data Type Conversion6' */ |
| 20480 | PositionFinalLimited = L4_MABX_B.SFunction1_o7_of; |
| 20481 | if (PositionFinalLimited < 256.0) { |
| 20482 | if (PositionFinalLimited >= 0.0) { |
| 20483 | starting_index = (uint8_T)PositionFinalLimited; |
| 20484 | } else { |
| 20485 | starting_index = 0U; |
| 20486 | } |
| 20487 | } else { |
| 20488 | starting_index = MAX_uint8_T; |
| 20489 | } |
| 20490 | |
| 20491 | L4_MABX_B.DataTypeConversion6_o = starting_index; |
| 20492 | |
| 20493 | /* End of DataTypeConversion: '<S584>/Data Type Conversion6' */ |
| 20494 | |
| 20495 | /* DataTypeConversion: '<S584>/Data Type Conversion7' */ |
| 20496 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_ah; |
| 20497 | if (PositionFinalLimited < 256.0) { |
| 20498 | if (PositionFinalLimited >= 0.0) { |
| 20499 | starting_index = (uint8_T)PositionFinalLimited; |
| 20500 | } else { |
| 20501 | starting_index = 0U; |
| 20502 | } |
| 20503 | } else { |
| 20504 | starting_index = MAX_uint8_T; |
| 20505 | } |
| 20506 | |
| 20507 | L4_MABX_B.DataTypeConversion7_k1 = starting_index; |
| 20508 | |
| 20509 | /* End of DataTypeConversion: '<S584>/Data Type Conversion7' */ |
| 20510 | |
| 20511 | /* MultiPortSwitch: '<S444>/Multiport_Switch' incorporates: |
| 20512 | * Constant: '<S444>/Constant' |
| 20513 | */ |
| 20514 | switch (PROPB_REAX_CHANNEL_APV) { |
| 20515 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 20516 | /* DataTypeConversion: '<S582>/Data Type Conversion' */ |
| 20517 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_ma; |
| 20518 | if (PositionFinalLimited < 256.0) { |
| 20519 | if (PositionFinalLimited >= 0.0) { |
| 20520 | starting_index = (uint8_T)PositionFinalLimited; |
| 20521 | } else { |
| 20522 | starting_index = 0U; |
| 20523 | } |
| 20524 | } else { |
| 20525 | starting_index = MAX_uint8_T; |
| 20526 | } |
| 20527 | |
| 20528 | L4_MABX_B.DataTypeConversion_ir = starting_index; |
| 20529 | |
| 20530 | /* End of DataTypeConversion: '<S582>/Data Type Conversion' */ |
| 20531 | |
| 20532 | /* DataTypeConversion: '<S582>/Data Type Conversion1' */ |
| 20533 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_k4; |
| 20534 | if (PositionFinalLimited < 256.0) { |
| 20535 | if (PositionFinalLimited >= 0.0) { |
| 20536 | starting_index = (uint8_T)PositionFinalLimited; |
| 20537 | } else { |
| 20538 | starting_index = 0U; |
| 20539 | } |
| 20540 | } else { |
| 20541 | starting_index = MAX_uint8_T; |
| 20542 | } |
| 20543 | |
| 20544 | L4_MABX_B.DataTypeConversion1_jw = starting_index; |
| 20545 | |
| 20546 | /* End of DataTypeConversion: '<S582>/Data Type Conversion1' */ |
| 20547 | |
| 20548 | /* DataTypeConversion: '<S582>/Data Type Conversion2' */ |
| 20549 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_p4z; |
| 20550 | if (PositionFinalLimited < 256.0) { |
| 20551 | if (PositionFinalLimited >= 0.0) { |
| 20552 | starting_index = (uint8_T)PositionFinalLimited; |
| 20553 | } else { |
| 20554 | starting_index = 0U; |
| 20555 | } |
| 20556 | } else { |
| 20557 | starting_index = MAX_uint8_T; |
| 20558 | } |
| 20559 | |
| 20560 | L4_MABX_B.DataTypeConversion2_e0 = starting_index; |
| 20561 | |
| 20562 | /* End of DataTypeConversion: '<S582>/Data Type Conversion2' */ |
| 20563 | |
| 20564 | /* DataTypeConversion: '<S582>/Data Type Conversion3' */ |
| 20565 | PositionFinalLimited = L4_MABX_B.SFunction1_o4_b3; |
| 20566 | if (PositionFinalLimited < 256.0) { |
| 20567 | if (PositionFinalLimited >= 0.0) { |
| 20568 | starting_index = (uint8_T)PositionFinalLimited; |
| 20569 | } else { |
| 20570 | starting_index = 0U; |
| 20571 | } |
| 20572 | } else { |
| 20573 | starting_index = MAX_uint8_T; |
| 20574 | } |
| 20575 | |
| 20576 | L4_MABX_B.DataTypeConversion3_o = starting_index; |
| 20577 | |
| 20578 | /* End of DataTypeConversion: '<S582>/Data Type Conversion3' */ |
| 20579 | |
| 20580 | /* DataTypeConversion: '<S582>/Data Type Conversion4' */ |
| 20581 | PositionFinalLimited = L4_MABX_B.SFunction1_o5_bb; |
| 20582 | if (PositionFinalLimited < 256.0) { |
| 20583 | if (PositionFinalLimited >= 0.0) { |
| 20584 | starting_index = (uint8_T)PositionFinalLimited; |
| 20585 | } else { |
| 20586 | starting_index = 0U; |
| 20587 | } |
| 20588 | } else { |
| 20589 | starting_index = MAX_uint8_T; |
| 20590 | } |
| 20591 | |
| 20592 | L4_MABX_B.DataTypeConversion4_j3 = starting_index; |
| 20593 | |
| 20594 | /* End of DataTypeConversion: '<S582>/Data Type Conversion4' */ |
| 20595 | |
| 20596 | /* DataTypeConversion: '<S582>/Data Type Conversion5' */ |
| 20597 | PositionFinalLimited = L4_MABX_B.SFunction1_o6_f; |
| 20598 | if (PositionFinalLimited < 256.0) { |
| 20599 | if (PositionFinalLimited >= 0.0) { |
| 20600 | starting_index = (uint8_T)PositionFinalLimited; |
| 20601 | } else { |
| 20602 | starting_index = 0U; |
| 20603 | } |
| 20604 | } else { |
| 20605 | starting_index = MAX_uint8_T; |
| 20606 | } |
| 20607 | |
| 20608 | L4_MABX_B.DataTypeConversion5_f = starting_index; |
| 20609 | |
| 20610 | /* End of DataTypeConversion: '<S582>/Data Type Conversion5' */ |
| 20611 | |
| 20612 | /* DataTypeConversion: '<S582>/Data Type Conversion6' */ |
| 20613 | PositionFinalLimited = L4_MABX_B.SFunction1_o7_kh; |
| 20614 | if (PositionFinalLimited < 256.0) { |
| 20615 | if (PositionFinalLimited >= 0.0) { |
| 20616 | starting_index = (uint8_T)PositionFinalLimited; |
| 20617 | } else { |
| 20618 | starting_index = 0U; |
| 20619 | } |
| 20620 | } else { |
| 20621 | starting_index = MAX_uint8_T; |
| 20622 | } |
| 20623 | |
| 20624 | L4_MABX_B.DataTypeConversion6_ao = starting_index; |
| 20625 | |
| 20626 | /* End of DataTypeConversion: '<S582>/Data Type Conversion6' */ |
| 20627 | |
| 20628 | /* DataTypeConversion: '<S582>/Data Type Conversion7' */ |
| 20629 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_od; |
| 20630 | if (PositionFinalLimited < 256.0) { |
| 20631 | if (PositionFinalLimited >= 0.0) { |
| 20632 | starting_index = (uint8_T)PositionFinalLimited; |
| 20633 | } else { |
| 20634 | starting_index = 0U; |
| 20635 | } |
| 20636 | } else { |
| 20637 | starting_index = MAX_uint8_T; |
| 20638 | } |
| 20639 | |
| 20640 | L4_MABX_B.DataTypeConversion7_cm = starting_index; |
| 20641 | |
| 20642 | /* End of DataTypeConversion: '<S582>/Data Type Conversion7' */ |
| 20643 | L4_MABX_B.RawData_h[0] = L4_MABX_B.DataTypeConversion_ir; |
| 20644 | L4_MABX_B.RawData_h[1] = L4_MABX_B.DataTypeConversion1_jw; |
| 20645 | L4_MABX_B.RawData_h[2] = L4_MABX_B.DataTypeConversion2_e0; |
| 20646 | L4_MABX_B.RawData_h[3] = L4_MABX_B.DataTypeConversion3_o; |
| 20647 | L4_MABX_B.RawData_h[4] = L4_MABX_B.DataTypeConversion4_j3; |
| 20648 | L4_MABX_B.RawData_h[5] = L4_MABX_B.DataTypeConversion5_f; |
| 20649 | L4_MABX_B.RawData_h[6] = L4_MABX_B.DataTypeConversion6_ao; |
| 20650 | L4_MABX_B.RawData_h[7] = L4_MABX_B.DataTypeConversion7_cm; |
| 20651 | break; |
| 20652 | |
| 20653 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 20654 | L4_MABX_B.RawData_h[0] = L4_MABX_B.DataTypeConversion_a3; |
| 20655 | L4_MABX_B.RawData_h[1] = L4_MABX_B.DataTypeConversion1_ay; |
| 20656 | L4_MABX_B.RawData_h[2] = L4_MABX_B.DataTypeConversion2_o5; |
| 20657 | L4_MABX_B.RawData_h[3] = L4_MABX_B.DataTypeConversion3_nb; |
| 20658 | L4_MABX_B.RawData_h[4] = L4_MABX_B.DataTypeConversion4_bn; |
| 20659 | L4_MABX_B.RawData_h[5] = L4_MABX_B.DataTypeConversion5_ke; |
| 20660 | L4_MABX_B.RawData_h[6] = L4_MABX_B.DataTypeConversion6_g; |
| 20661 | L4_MABX_B.RawData_h[7] = L4_MABX_B.DataTypeConversion7_d; |
| 20662 | break; |
| 20663 | |
| 20664 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 20665 | L4_MABX_B.RawData_h[0] = L4_MABX_B.DataTypeConversion_a3; |
| 20666 | L4_MABX_B.RawData_h[1] = L4_MABX_B.DataTypeConversion1_ay; |
| 20667 | L4_MABX_B.RawData_h[2] = L4_MABX_B.DataTypeConversion2_o5; |
| 20668 | L4_MABX_B.RawData_h[3] = L4_MABX_B.DataTypeConversion3_nb; |
| 20669 | L4_MABX_B.RawData_h[4] = L4_MABX_B.DataTypeConversion4_bn; |
| 20670 | L4_MABX_B.RawData_h[5] = L4_MABX_B.DataTypeConversion5_ke; |
| 20671 | L4_MABX_B.RawData_h[6] = L4_MABX_B.DataTypeConversion6_g; |
| 20672 | L4_MABX_B.RawData_h[7] = L4_MABX_B.DataTypeConversion7_d; |
| 20673 | break; |
| 20674 | |
| 20675 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 20676 | L4_MABX_B.RawData_h[0] = L4_MABX_B.DataTypeConversion_a3; |
| 20677 | L4_MABX_B.RawData_h[1] = L4_MABX_B.DataTypeConversion1_ay; |
| 20678 | L4_MABX_B.RawData_h[2] = L4_MABX_B.DataTypeConversion2_o5; |
| 20679 | L4_MABX_B.RawData_h[3] = L4_MABX_B.DataTypeConversion3_nb; |
| 20680 | L4_MABX_B.RawData_h[4] = L4_MABX_B.DataTypeConversion4_bn; |
| 20681 | L4_MABX_B.RawData_h[5] = L4_MABX_B.DataTypeConversion5_ke; |
| 20682 | L4_MABX_B.RawData_h[6] = L4_MABX_B.DataTypeConversion6_g; |
| 20683 | L4_MABX_B.RawData_h[7] = L4_MABX_B.DataTypeConversion7_d; |
| 20684 | break; |
| 20685 | |
| 20686 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 20687 | L4_MABX_B.RawData_h[0] = L4_MABX_B.DataTypeConversion_a3; |
| 20688 | L4_MABX_B.RawData_h[1] = L4_MABX_B.DataTypeConversion1_ay; |
| 20689 | L4_MABX_B.RawData_h[2] = L4_MABX_B.DataTypeConversion2_o5; |
| 20690 | L4_MABX_B.RawData_h[3] = L4_MABX_B.DataTypeConversion3_nb; |
| 20691 | L4_MABX_B.RawData_h[4] = L4_MABX_B.DataTypeConversion4_bn; |
| 20692 | L4_MABX_B.RawData_h[5] = L4_MABX_B.DataTypeConversion5_ke; |
| 20693 | L4_MABX_B.RawData_h[6] = L4_MABX_B.DataTypeConversion6_g; |
| 20694 | L4_MABX_B.RawData_h[7] = L4_MABX_B.DataTypeConversion7_d; |
| 20695 | break; |
| 20696 | |
| 20697 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 20698 | L4_MABX_B.RawData_h[0] = L4_MABX_B.DataTypeConversion_om; |
| 20699 | L4_MABX_B.RawData_h[1] = L4_MABX_B.DataTypeConversion1_a2; |
| 20700 | L4_MABX_B.RawData_h[2] = L4_MABX_B.DataTypeConversion2_p2; |
| 20701 | L4_MABX_B.RawData_h[3] = L4_MABX_B.DataTypeConversion3_bh; |
| 20702 | L4_MABX_B.RawData_h[4] = L4_MABX_B.DataTypeConversion4_ic; |
| 20703 | L4_MABX_B.RawData_h[5] = L4_MABX_B.DataTypeConversion5_kt; |
| 20704 | L4_MABX_B.RawData_h[6] = L4_MABX_B.DataTypeConversion6_o; |
| 20705 | L4_MABX_B.RawData_h[7] = L4_MABX_B.DataTypeConversion7_k1; |
| 20706 | break; |
| 20707 | |
| 20708 | default: |
| 20709 | L4_MABX_B.RawData_h[0] = L4_MABX_B.DataTypeConversion_om; |
| 20710 | L4_MABX_B.RawData_h[1] = L4_MABX_B.DataTypeConversion1_a2; |
| 20711 | L4_MABX_B.RawData_h[2] = L4_MABX_B.DataTypeConversion2_p2; |
| 20712 | L4_MABX_B.RawData_h[3] = L4_MABX_B.DataTypeConversion3_bh; |
| 20713 | L4_MABX_B.RawData_h[4] = L4_MABX_B.DataTypeConversion4_ic; |
| 20714 | L4_MABX_B.RawData_h[5] = L4_MABX_B.DataTypeConversion5_kt; |
| 20715 | L4_MABX_B.RawData_h[6] = L4_MABX_B.DataTypeConversion6_o; |
| 20716 | L4_MABX_B.RawData_h[7] = L4_MABX_B.DataTypeConversion7_k1; |
| 20717 | break; |
| 20718 | } |
| 20719 | |
| 20720 | /* S-Function (sfix_bitop): '<S672>/Operator' */ |
| 20721 | L4_MABX_B.Operator_na = (uint8_T)(L4_MABX_B.RawData_h[0] & |
| 20722 | L4_MABX_P.Operator_BitMask_kh); |
| 20723 | |
| 20724 | /* DataTypeConversion: '<S672>/DataType' */ |
| 20725 | L4_MABX_B.DataType_kra = L4_MABX_B.Operator_na; |
| 20726 | |
| 20727 | /* DataTypeConversion: '<S419>/Data Type Conversion' */ |
| 20728 | REAX_Current_Mode = L4_MABX_B.DataType_kra; |
| 20729 | |
| 20730 | /* S-Function (sfix_bitop): '<S671>/Operator' */ |
| 20731 | L4_MABX_B.Operator_c1 = (uint8_T)(L4_MABX_B.RawData_h[0] & |
| 20732 | L4_MABX_P.Operator_BitMask_d4); |
| 20733 | |
| 20734 | /* DataTypeConversion: '<S671>/DataType' */ |
| 20735 | L4_MABX_B.DataType_jl = L4_MABX_B.Operator_c1; |
| 20736 | |
| 20737 | /* ArithShift: '<S666>/Shift_Arithmetic ' */ |
| 20738 | L4_MABX_B.PropB_REAX_3_ReqOperatingMode = (uint8_T)((uint32_T) |
| 20739 | L4_MABX_B.DataType_jl >> 4); |
| 20740 | |
| 20741 | /* DataTypeConversion: '<S419>/Data Type Conversion1' */ |
| 20742 | REAX_Req_Mode = L4_MABX_B.PropB_REAX_3_ReqOperatingMode; |
| 20743 | |
| 20744 | /* DataTypeConversion: '<S419>/Data Type Conversion2' */ |
| 20745 | REAX_Status = L4_MABX_B.RawData_h[1]; |
| 20746 | |
| 20747 | /* DataTypeConversion: '<S668>/Data Type Conversion1' */ |
| 20748 | L4_MABX_B.DataTypeConversion1_ij = L4_MABX_B.RawData_h[2]; |
| 20749 | |
| 20750 | /* DataTypeConversion: '<S668>/Data Type Conversion2' */ |
| 20751 | L4_MABX_B.DataTypeConversion2_ho = L4_MABX_B.RawData_h[3]; |
| 20752 | |
| 20753 | /* ArithShift: '<S668>/Shift_Arithmetic 1' */ |
| 20754 | L4_MABX_B.Shift_Arithmetic1_jh = (uint16_T)(L4_MABX_B.DataTypeConversion2_ho << |
| 20755 | 8); |
| 20756 | |
| 20757 | /* S-Function (sfix_bitop): '<S673>/Operator' */ |
| 20758 | L4_MABX_B.Operator_dz = (uint16_T)(L4_MABX_B.DataTypeConversion1_ij | |
| 20759 | L4_MABX_B.Shift_Arithmetic1_jh); |
| 20760 | |
| 20761 | /* DataTypeConversion: '<S673>/DataType' */ |
| 20762 | L4_MABX_B.DataType_iz = L4_MABX_B.Operator_dz; |
| 20763 | |
| 20764 | /* DataTypeConversion: '<S668>/Data Type Conversion3' */ |
| 20765 | L4_MABX_B.DataTypeConversion3_k = (int16_T)L4_MABX_B.DataType_iz; |
| 20766 | |
| 20767 | /* DataTypeConversion: '<S668>/Data Type Conversion4' */ |
| 20768 | L4_MABX_B.DataTypeConversion4_c = L4_MABX_B.DataTypeConversion3_k; |
| 20769 | |
| 20770 | /* Product: '<S668>/Product' incorporates: |
| 20771 | * Constant: '<S668>/Constant' |
| 20772 | */ |
| 20773 | L4_MABX_B.PropB_REAX_3_HandwheelTorque = (real32_T) |
| 20774 | (L4_MABX_B.DataTypeConversion4_c * L4_MABX_P.Constant_Value_nr); |
| 20775 | |
| 20776 | /* DataTypeConversion: '<S419>/Data Type Conversion3' */ |
| 20777 | REAX_Handwheel_Torque = L4_MABX_B.PropB_REAX_3_HandwheelTorque; |
| 20778 | |
| 20779 | /* DataTypeConversion: '<S669>/Data Type Conversion4' */ |
| 20780 | L4_MABX_B.DataTypeConversion4_l = L4_MABX_B.RawData_h[4]; |
| 20781 | |
| 20782 | /* DataTypeConversion: '<S669>/Data Type Conversion5' */ |
| 20783 | L4_MABX_B.DataTypeConversion5_dg = L4_MABX_B.RawData_h[5]; |
| 20784 | |
| 20785 | /* ArithShift: '<S669>/Shift_Arithmetic 2' */ |
| 20786 | L4_MABX_B.Shift_Arithmetic2_je = (uint16_T)(L4_MABX_B.DataTypeConversion5_dg << |
| 20787 | 8); |
| 20788 | |
| 20789 | /* S-Function (sfix_bitop): '<S674>/Operator' */ |
| 20790 | L4_MABX_B.Operator_hg = (uint16_T)(L4_MABX_B.DataTypeConversion4_l | |
| 20791 | L4_MABX_B.Shift_Arithmetic2_je); |
| 20792 | |
| 20793 | /* DataTypeConversion: '<S674>/DataType' */ |
| 20794 | L4_MABX_B.DataType_in = L4_MABX_B.Operator_hg; |
| 20795 | |
| 20796 | /* DataTypeConversion: '<S669>/Data Type Conversion6' */ |
| 20797 | L4_MABX_B.DataTypeConversion6_mm = (int16_T)L4_MABX_B.DataType_in; |
| 20798 | |
| 20799 | /* DataTypeConversion: '<S669>/Data Type Conversion1' */ |
| 20800 | L4_MABX_B.DataTypeConversion1_d = L4_MABX_B.DataTypeConversion6_mm; |
| 20801 | |
| 20802 | /* Product: '<S669>/Product1' incorporates: |
| 20803 | * Constant: '<S669>/Constant1' |
| 20804 | */ |
| 20805 | L4_MABX_B.PropB_REAX_3_HandwheelVelocity = (real32_T) |
| 20806 | (L4_MABX_B.DataTypeConversion1_d * L4_MABX_P.Constant1_Value_b); |
| 20807 | |
| 20808 | /* DataTypeConversion: '<S419>/Data Type Conversion4' */ |
| 20809 | REAX_Handwheel_Velocity = L4_MABX_B.PropB_REAX_3_HandwheelVelocity; |
| 20810 | |
| 20811 | /* DataTypeConversion: '<S670>/Data Type Conversion7' */ |
| 20812 | L4_MABX_B.DataTypeConversion7_o = L4_MABX_B.RawData_h[6]; |
| 20813 | |
| 20814 | /* DataTypeConversion: '<S670>/Data Type Conversion8' */ |
| 20815 | L4_MABX_B.DataTypeConversion8_d5 = L4_MABX_B.RawData_h[7]; |
| 20816 | |
| 20817 | /* ArithShift: '<S670>/Shift_Arithmetic 3' */ |
| 20818 | L4_MABX_B.Shift_Arithmetic3_la = (uint16_T)(L4_MABX_B.DataTypeConversion8_d5 << |
| 20819 | 8); |
| 20820 | |
| 20821 | /* S-Function (sfix_bitop): '<S675>/Operator' */ |
| 20822 | L4_MABX_B.Operator_lk = (uint16_T)(L4_MABX_B.DataTypeConversion7_o | |
| 20823 | L4_MABX_B.Shift_Arithmetic3_la); |
| 20824 | |
| 20825 | /* DataTypeConversion: '<S675>/DataType' */ |
| 20826 | L4_MABX_B.DataType_io = L4_MABX_B.Operator_lk; |
| 20827 | |
| 20828 | /* DataTypeConversion: '<S670>/Data Type Conversion9' */ |
| 20829 | L4_MABX_B.DataTypeConversion9_k = (int16_T)L4_MABX_B.DataType_io; |
| 20830 | |
| 20831 | /* DataTypeConversion: '<S670>/Data Type Conversion1' */ |
| 20832 | L4_MABX_B.DataTypeConversion1_a = L4_MABX_B.DataTypeConversion9_k; |
| 20833 | |
| 20834 | /* Product: '<S670>/Product2' incorporates: |
| 20835 | * Constant: '<S670>/Constant2' |
| 20836 | */ |
| 20837 | L4_MABX_B.PropB_REAX_3_PullCompensation = (real32_T) |
| 20838 | (L4_MABX_B.DataTypeConversion1_a * L4_MABX_P.Constant2_Value_br); |
| 20839 | |
| 20840 | /* DataTypeConversion: '<S419>/Data Type Conversion5' */ |
| 20841 | REAX_Pull_Compensation = L4_MABX_B.PropB_REAX_3_PullCompensation; |
| 20842 | |
| 20843 | /* DataTypeConversion: '<S583>/Data Type Conversion8' */ |
| 20844 | L4_MABX_B.RX_status_dj = (L4_MABX_B.SFunction1_o9_j != 0.0); |
| 20845 | |
| 20846 | /* DataTypeConversion: '<S584>/Data Type Conversion8' */ |
| 20847 | L4_MABX_B.RX_status_oy = (L4_MABX_B.SFunction1_o9_b != 0.0); |
| 20848 | |
| 20849 | /* MultiPortSwitch: '<S444>/Multiport_Switch' incorporates: |
| 20850 | * Constant: '<S444>/Constant' |
| 20851 | */ |
| 20852 | switch (PROPB_REAX_CHANNEL_APV) { |
| 20853 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 20854 | /* DataTypeConversion: '<S582>/Data Type Conversion8' */ |
| 20855 | L4_MABX_B.RX_status_le = (L4_MABX_B.SFunction1_o9_hj != 0.0); |
| 20856 | L4_MABX_B.RX_status_iw = L4_MABX_B.RX_status_le; |
| 20857 | break; |
| 20858 | |
| 20859 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 20860 | L4_MABX_B.RX_status_iw = L4_MABX_B.RX_status_dj; |
| 20861 | break; |
| 20862 | |
| 20863 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 20864 | L4_MABX_B.RX_status_iw = L4_MABX_B.RX_status_dj; |
| 20865 | break; |
| 20866 | |
| 20867 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 20868 | L4_MABX_B.RX_status_iw = L4_MABX_B.RX_status_dj; |
| 20869 | break; |
| 20870 | |
| 20871 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 20872 | L4_MABX_B.RX_status_iw = L4_MABX_B.RX_status_dj; |
| 20873 | break; |
| 20874 | |
| 20875 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 20876 | L4_MABX_B.RX_status_iw = L4_MABX_B.RX_status_oy; |
| 20877 | break; |
| 20878 | |
| 20879 | default: |
| 20880 | L4_MABX_B.RX_status_iw = L4_MABX_B.RX_status_oy; |
| 20881 | break; |
| 20882 | } |
| 20883 | |
| 20884 | /* DataTypeConversion: '<S583>/Data Type Conversion9' */ |
| 20885 | L4_MABX_B.RX_time_db = L4_MABX_B.SFunction1_o10_ay; |
| 20886 | |
| 20887 | /* DataTypeConversion: '<S584>/Data Type Conversion9' */ |
| 20888 | L4_MABX_B.RX_time_mw = L4_MABX_B.SFunction1_o10_k; |
| 20889 | |
| 20890 | /* MultiPortSwitch: '<S444>/Multiport_Switch' incorporates: |
| 20891 | * Constant: '<S444>/Constant' |
| 20892 | */ |
| 20893 | switch (PROPB_REAX_CHANNEL_APV) { |
| 20894 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 20895 | /* DataTypeConversion: '<S582>/Data Type Conversion9' */ |
| 20896 | L4_MABX_B.RX_time_id = L4_MABX_B.SFunction1_o10_n5; |
| 20897 | L4_MABX_B.RX_time_gw = L4_MABX_B.RX_time_id; |
| 20898 | break; |
| 20899 | |
| 20900 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 20901 | L4_MABX_B.RX_time_gw = L4_MABX_B.RX_time_db; |
| 20902 | break; |
| 20903 | |
| 20904 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 20905 | L4_MABX_B.RX_time_gw = L4_MABX_B.RX_time_db; |
| 20906 | break; |
| 20907 | |
| 20908 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 20909 | L4_MABX_B.RX_time_gw = L4_MABX_B.RX_time_db; |
| 20910 | break; |
| 20911 | |
| 20912 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 20913 | L4_MABX_B.RX_time_gw = L4_MABX_B.RX_time_db; |
| 20914 | break; |
| 20915 | |
| 20916 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 20917 | L4_MABX_B.RX_time_gw = L4_MABX_B.RX_time_mw; |
| 20918 | break; |
| 20919 | |
| 20920 | default: |
| 20921 | L4_MABX_B.RX_time_gw = L4_MABX_B.RX_time_mw; |
| 20922 | break; |
| 20923 | } |
| 20924 | |
| 20925 | /* DataTypeConversion: '<S583>/Data Type Conversion10' */ |
| 20926 | L4_MABX_B.RX_delta_time_bk = L4_MABX_B.SFunction1_o11_om; |
| 20927 | |
| 20928 | /* DataTypeConversion: '<S584>/Data Type Conversion10' */ |
| 20929 | L4_MABX_B.RX_delta_time_gf = L4_MABX_B.SFunction1_o11_kc; |
| 20930 | |
| 20931 | /* MultiPortSwitch: '<S444>/Multiport_Switch' incorporates: |
| 20932 | * Constant: '<S444>/Constant' |
| 20933 | */ |
| 20934 | switch (PROPB_REAX_CHANNEL_APV) { |
| 20935 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 20936 | /* DataTypeConversion: '<S582>/Data Type Conversion10' */ |
| 20937 | L4_MABX_B.RX_delta_time_bd = L4_MABX_B.SFunction1_o11_e; |
| 20938 | L4_MABX_B.RX_delta_time_ab = L4_MABX_B.RX_delta_time_bd; |
| 20939 | break; |
| 20940 | |
| 20941 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 20942 | L4_MABX_B.RX_delta_time_ab = L4_MABX_B.RX_delta_time_bk; |
| 20943 | break; |
| 20944 | |
| 20945 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 20946 | L4_MABX_B.RX_delta_time_ab = L4_MABX_B.RX_delta_time_bk; |
| 20947 | break; |
| 20948 | |
| 20949 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 20950 | L4_MABX_B.RX_delta_time_ab = L4_MABX_B.RX_delta_time_bk; |
| 20951 | break; |
| 20952 | |
| 20953 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 20954 | L4_MABX_B.RX_delta_time_ab = L4_MABX_B.RX_delta_time_bk; |
| 20955 | break; |
| 20956 | |
| 20957 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 20958 | L4_MABX_B.RX_delta_time_ab = L4_MABX_B.RX_delta_time_gf; |
| 20959 | break; |
| 20960 | |
| 20961 | default: |
| 20962 | L4_MABX_B.RX_delta_time_ab = L4_MABX_B.RX_delta_time_gf; |
| 20963 | break; |
| 20964 | } |
| 20965 | |
| 20966 | /* RelationalOperator: '<S591>/Operator' incorporates: |
| 20967 | * Constant: '<S444>/Constant' |
| 20968 | * Constant: '<S585>/Constant2' |
| 20969 | */ |
| 20970 | L4_MABX_B.Operator_m4m = (PROPB_REAX_CHANNEL_APV == |
| 20971 | L4_MABX_P.Constant2_Value_mm); |
| 20972 | |
| 20973 | /* RelationalOperator: '<S592>/Operator' incorporates: |
| 20974 | * Constant: '<S444>/Constant' |
| 20975 | * Constant: '<S585>/Constant3' |
| 20976 | */ |
| 20977 | L4_MABX_B.Operator_ib = (PROPB_REAX_CHANNEL_APV == L4_MABX_P.Constant3_Value_c); |
| 20978 | |
| 20979 | /* RelationalOperator: '<S593>/Operator' incorporates: |
| 20980 | * Constant: '<S444>/Constant' |
| 20981 | * Constant: '<S585>/Constant4' |
| 20982 | */ |
| 20983 | L4_MABX_B.Operator_hv = (PROPB_REAX_CHANNEL_APV == |
| 20984 | L4_MABX_P.Constant4_Value_kt); |
| 20985 | |
| 20986 | /* RelationalOperator: '<S602>/Operator' incorporates: |
| 20987 | * Constant: '<S445>/Constant' |
| 20988 | * Constant: '<S598>/Constant' |
| 20989 | */ |
| 20990 | L4_MABX_B.Operator_h4 = (PROPB_REAX_CHANNEL_APV == L4_MABX_P.Constant_Value_fn); |
| 20991 | |
| 20992 | /* Outputs for Enabled SubSystem: '<S595>/CAN_TYPE1_RX_M1_C1' incorporates: |
| 20993 | * EnablePort: '<S599>/Enable' |
| 20994 | */ |
| 20995 | if (L4_MABX_B.Operator_h4) { |
| 20996 | /* S-Function (rti_commonblock): '<S599>/S-Function1' */ |
| 20997 | /* This comment workarounds a code generation problem */ |
| 20998 | |
| 20999 | /* dSPACE RTICAN RX Message Block: "PropB_REAX_4_13" Id:419428115 */ |
| 21000 | { |
| 21001 | UInt32 *CAN_Msg; |
| 21002 | static dsfloat time_old = 0.0; |
| 21003 | |
| 21004 | /* Read status and timestamp info (previous message) */ |
| 21005 | if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF713].timestamp != |
| 21006 | time_old) { |
| 21007 | /* ... save timestamp info for the calculation of the RX status |
| 21008 | during the consecutive sample hit*/ |
| 21009 | time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF713]. |
| 21010 | timestamp; |
| 21011 | |
| 21012 | /* ... set the processed flag to one */ |
| 21013 | L4_MABX_B.SFunction1_o9_d = 1.0; |
| 21014 | L4_MABX_B.SFunction1_o10_g = (real_T) |
| 21015 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF713].timestamp; |
| 21016 | L4_MABX_B.SFunction1_o11_k = (real_T) |
| 21017 | can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF713].deltatime; |
| 21018 | CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF713].data; |
| 21019 | |
| 21020 | /* Decode CAN message */ |
| 21021 | { |
| 21022 | { |
| 21023 | rtican_Signal_t CAN_Sgn; |
| 21024 | |
| 21025 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 21026 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 21027 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21028 | L4_MABX_B.SFunction1_o1_ek = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21029 | |
| 21030 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 21031 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 21032 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21033 | L4_MABX_B.SFunction1_o2_cf = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21034 | |
| 21035 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 21036 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 21037 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21038 | L4_MABX_B.SFunction1_o3_bl = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21039 | |
| 21040 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 21041 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 21042 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21043 | L4_MABX_B.SFunction1_o4_p = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21044 | |
| 21045 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 21046 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 21047 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21048 | L4_MABX_B.SFunction1_o5_ed = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21049 | |
| 21050 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 21051 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 21052 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21053 | L4_MABX_B.SFunction1_o6_c = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21054 | |
| 21055 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 21056 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 21057 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21058 | L4_MABX_B.SFunction1_o7_f = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21059 | |
| 21060 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 21061 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 21062 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21063 | L4_MABX_B.SFunction1_o8_o = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21064 | } |
| 21065 | } |
| 21066 | } else { |
| 21067 | /* set RX status to 0 because no new message has arrived */ |
| 21068 | L4_MABX_B.SFunction1_o9_d = 0.0; |
| 21069 | } |
| 21070 | } |
| 21071 | } |
| 21072 | |
| 21073 | /* End of Outputs for SubSystem: '<S595>/CAN_TYPE1_RX_M1_C1' */ |
| 21074 | |
| 21075 | /* RelationalOperator: '<S603>/Operator' incorporates: |
| 21076 | * Constant: '<S445>/Constant' |
| 21077 | * Constant: '<S598>/Constant1' |
| 21078 | */ |
| 21079 | L4_MABX_B.Operator_cp = (PROPB_REAX_CHANNEL_APV == |
| 21080 | L4_MABX_P.Constant1_Value_fz); |
| 21081 | |
| 21082 | /* Outputs for Enabled SubSystem: '<S596>/CAN_TYPE1_RX_M1_C2' incorporates: |
| 21083 | * EnablePort: '<S600>/Enable' |
| 21084 | */ |
| 21085 | if (L4_MABX_B.Operator_cp) { |
| 21086 | /* S-Function (rti_commonblock): '<S600>/S-Function1' */ |
| 21087 | /* This comment workarounds a code generation problem */ |
| 21088 | |
| 21089 | /* dSPACE RTICAN RX Message Block: "PropB_REAX_4_13" Id:419428115 */ |
| 21090 | { |
| 21091 | UInt32 *CAN_Msg; |
| 21092 | static dsfloat time_old = 0.0; |
| 21093 | |
| 21094 | /* Read status and timestamp info (previous message) */ |
| 21095 | if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF713].timestamp != |
| 21096 | time_old) { |
| 21097 | /* ... save timestamp info for the calculation of the RX status |
| 21098 | during the consecutive sample hit*/ |
| 21099 | time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF713]. |
| 21100 | timestamp; |
| 21101 | |
| 21102 | /* ... set the processed flag to one */ |
| 21103 | L4_MABX_B.SFunction1_o9_c = 1.0; |
| 21104 | L4_MABX_B.SFunction1_o10_c = (real_T) |
| 21105 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF713].timestamp; |
| 21106 | L4_MABX_B.SFunction1_o11_o = (real_T) |
| 21107 | can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF713].deltatime; |
| 21108 | CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF713].data; |
| 21109 | |
| 21110 | /* Decode CAN message */ |
| 21111 | { |
| 21112 | { |
| 21113 | rtican_Signal_t CAN_Sgn; |
| 21114 | |
| 21115 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 21116 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 21117 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21118 | L4_MABX_B.SFunction1_o1_km = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21119 | |
| 21120 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 21121 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 21122 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21123 | L4_MABX_B.SFunction1_o2_po = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21124 | |
| 21125 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 21126 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 21127 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21128 | L4_MABX_B.SFunction1_o3_mb = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21129 | |
| 21130 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 21131 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 21132 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21133 | L4_MABX_B.SFunction1_o4_m4 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21134 | |
| 21135 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 21136 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 21137 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21138 | L4_MABX_B.SFunction1_o5_ac = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21139 | |
| 21140 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 21141 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 21142 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21143 | L4_MABX_B.SFunction1_o6_kg = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21144 | |
| 21145 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 21146 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 21147 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21148 | L4_MABX_B.SFunction1_o7_ow = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21149 | |
| 21150 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 21151 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 21152 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21153 | L4_MABX_B.SFunction1_o8_n1 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21154 | } |
| 21155 | } |
| 21156 | } else { |
| 21157 | /* set RX status to 0 because no new message has arrived */ |
| 21158 | L4_MABX_B.SFunction1_o9_c = 0.0; |
| 21159 | } |
| 21160 | } |
| 21161 | } |
| 21162 | |
| 21163 | /* End of Outputs for SubSystem: '<S596>/CAN_TYPE1_RX_M1_C2' */ |
| 21164 | |
| 21165 | /* RelationalOperator: '<S607>/Operator' incorporates: |
| 21166 | * Constant: '<S445>/Constant' |
| 21167 | * Constant: '<S598>/Constant5' |
| 21168 | */ |
| 21169 | L4_MABX_B.Operator_io = (PROPB_REAX_CHANNEL_APV == |
| 21170 | L4_MABX_P.Constant5_Value_oz); |
| 21171 | |
| 21172 | /* Outputs for Enabled SubSystem: '<S597>/CAN_TYPE1_RX_M3_C2' incorporates: |
| 21173 | * EnablePort: '<S601>/Enable' |
| 21174 | */ |
| 21175 | if (L4_MABX_B.Operator_io) { |
| 21176 | /* S-Function (rti_commonblock): '<S601>/S-Function1' */ |
| 21177 | /* This comment workarounds a code generation problem */ |
| 21178 | |
| 21179 | /* dSPACE RTICAN RX Message Block: "PropB_REAX_4_13" Id:486536979 */ |
| 21180 | { |
| 21181 | UInt32 *CAN_Msg; |
| 21182 | static dsfloat time_old = 0.0; |
| 21183 | |
| 21184 | /* Read status and timestamp info (previous message) */ |
| 21185 | if (can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF713].timestamp != |
| 21186 | time_old) { |
| 21187 | /* ... save timestamp info for the calculation of the RX status |
| 21188 | during the consecutive sample hit*/ |
| 21189 | time_old = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF713]. |
| 21190 | timestamp; |
| 21191 | |
| 21192 | /* ... set the processed flag to one */ |
| 21193 | L4_MABX_B.SFunction1_o9_on = 1.0; |
| 21194 | L4_MABX_B.SFunction1_o10_of = (real_T) |
| 21195 | can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF713].timestamp; |
| 21196 | L4_MABX_B.SFunction1_o11_d = (real_T) |
| 21197 | can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF713].deltatime; |
| 21198 | CAN_Msg = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF713].data; |
| 21199 | |
| 21200 | /* Decode CAN message */ |
| 21201 | { |
| 21202 | { |
| 21203 | rtican_Signal_t CAN_Sgn; |
| 21204 | |
| 21205 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 21206 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0]; |
| 21207 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21208 | L4_MABX_B.SFunction1_o1_e = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21209 | |
| 21210 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 21211 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1]; |
| 21212 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21213 | L4_MABX_B.SFunction1_o2_mi = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21214 | |
| 21215 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 21216 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2]; |
| 21217 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21218 | L4_MABX_B.SFunction1_o3_bx = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21219 | |
| 21220 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 21221 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3]; |
| 21222 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21223 | L4_MABX_B.SFunction1_o4_cv5 = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21224 | |
| 21225 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 21226 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4]; |
| 21227 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21228 | L4_MABX_B.SFunction1_o5_dg = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21229 | |
| 21230 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 21231 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5]; |
| 21232 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21233 | L4_MABX_B.SFunction1_o6_m = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21234 | |
| 21235 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 21236 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6]; |
| 21237 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21238 | L4_MABX_B.SFunction1_o7_o = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21239 | |
| 21240 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 21241 | CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7]; |
| 21242 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 21243 | L4_MABX_B.SFunction1_o8_p = ((real_T) CAN_Sgn.UnsignedSgn); |
| 21244 | } |
| 21245 | } |
| 21246 | } else { |
| 21247 | /* set RX status to 0 because no new message has arrived */ |
| 21248 | L4_MABX_B.SFunction1_o9_on = 0.0; |
| 21249 | } |
| 21250 | } |
| 21251 | } |
| 21252 | |
| 21253 | /* End of Outputs for SubSystem: '<S597>/CAN_TYPE1_RX_M3_C2' */ |
| 21254 | |
| 21255 | /* DataTypeConversion: '<S597>/Data Type Conversion' */ |
| 21256 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_e; |
| 21257 | if (PositionFinalLimited < 256.0) { |
| 21258 | if (PositionFinalLimited >= 0.0) { |
| 21259 | starting_index = (uint8_T)PositionFinalLimited; |
| 21260 | } else { |
| 21261 | starting_index = 0U; |
| 21262 | } |
| 21263 | } else { |
| 21264 | starting_index = MAX_uint8_T; |
| 21265 | } |
| 21266 | |
| 21267 | L4_MABX_B.DataTypeConversion_lm = starting_index; |
| 21268 | |
| 21269 | /* End of DataTypeConversion: '<S597>/Data Type Conversion' */ |
| 21270 | |
| 21271 | /* DataTypeConversion: '<S597>/Data Type Conversion1' */ |
| 21272 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_mi; |
| 21273 | if (PositionFinalLimited < 256.0) { |
| 21274 | if (PositionFinalLimited >= 0.0) { |
| 21275 | starting_index = (uint8_T)PositionFinalLimited; |
| 21276 | } else { |
| 21277 | starting_index = 0U; |
| 21278 | } |
| 21279 | } else { |
| 21280 | starting_index = MAX_uint8_T; |
| 21281 | } |
| 21282 | |
| 21283 | L4_MABX_B.DataTypeConversion1_fb = starting_index; |
| 21284 | |
| 21285 | /* End of DataTypeConversion: '<S597>/Data Type Conversion1' */ |
| 21286 | |
| 21287 | /* DataTypeConversion: '<S597>/Data Type Conversion2' */ |
| 21288 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_bx; |
| 21289 | if (PositionFinalLimited < 256.0) { |
| 21290 | if (PositionFinalLimited >= 0.0) { |
| 21291 | starting_index = (uint8_T)PositionFinalLimited; |
| 21292 | } else { |
| 21293 | starting_index = 0U; |
| 21294 | } |
| 21295 | } else { |
| 21296 | starting_index = MAX_uint8_T; |
| 21297 | } |
| 21298 | |
| 21299 | L4_MABX_B.DataTypeConversion2_bv = starting_index; |
| 21300 | |
| 21301 | /* End of DataTypeConversion: '<S597>/Data Type Conversion2' */ |
| 21302 | |
| 21303 | /* DataTypeConversion: '<S597>/Data Type Conversion3' */ |
| 21304 | PositionFinalLimited = L4_MABX_B.SFunction1_o4_cv5; |
| 21305 | if (PositionFinalLimited < 256.0) { |
| 21306 | if (PositionFinalLimited >= 0.0) { |
| 21307 | starting_index = (uint8_T)PositionFinalLimited; |
| 21308 | } else { |
| 21309 | starting_index = 0U; |
| 21310 | } |
| 21311 | } else { |
| 21312 | starting_index = MAX_uint8_T; |
| 21313 | } |
| 21314 | |
| 21315 | L4_MABX_B.DataTypeConversion3_n2 = starting_index; |
| 21316 | |
| 21317 | /* End of DataTypeConversion: '<S597>/Data Type Conversion3' */ |
| 21318 | |
| 21319 | /* DataTypeConversion: '<S597>/Data Type Conversion4' */ |
| 21320 | PositionFinalLimited = L4_MABX_B.SFunction1_o5_dg; |
| 21321 | if (PositionFinalLimited < 256.0) { |
| 21322 | if (PositionFinalLimited >= 0.0) { |
| 21323 | starting_index = (uint8_T)PositionFinalLimited; |
| 21324 | } else { |
| 21325 | starting_index = 0U; |
| 21326 | } |
| 21327 | } else { |
| 21328 | starting_index = MAX_uint8_T; |
| 21329 | } |
| 21330 | |
| 21331 | L4_MABX_B.DataTypeConversion4_ir = starting_index; |
| 21332 | |
| 21333 | /* End of DataTypeConversion: '<S597>/Data Type Conversion4' */ |
| 21334 | |
| 21335 | /* DataTypeConversion: '<S597>/Data Type Conversion5' */ |
| 21336 | PositionFinalLimited = L4_MABX_B.SFunction1_o6_m; |
| 21337 | if (PositionFinalLimited < 256.0) { |
| 21338 | if (PositionFinalLimited >= 0.0) { |
| 21339 | starting_index = (uint8_T)PositionFinalLimited; |
| 21340 | } else { |
| 21341 | starting_index = 0U; |
| 21342 | } |
| 21343 | } else { |
| 21344 | starting_index = MAX_uint8_T; |
| 21345 | } |
| 21346 | |
| 21347 | L4_MABX_B.DataTypeConversion5_e3 = starting_index; |
| 21348 | |
| 21349 | /* End of DataTypeConversion: '<S597>/Data Type Conversion5' */ |
| 21350 | |
| 21351 | /* DataTypeConversion: '<S597>/Data Type Conversion6' */ |
| 21352 | PositionFinalLimited = L4_MABX_B.SFunction1_o7_o; |
| 21353 | if (PositionFinalLimited < 256.0) { |
| 21354 | if (PositionFinalLimited >= 0.0) { |
| 21355 | starting_index = (uint8_T)PositionFinalLimited; |
| 21356 | } else { |
| 21357 | starting_index = 0U; |
| 21358 | } |
| 21359 | } else { |
| 21360 | starting_index = MAX_uint8_T; |
| 21361 | } |
| 21362 | |
| 21363 | L4_MABX_B.DataTypeConversion6_fqb = starting_index; |
| 21364 | |
| 21365 | /* End of DataTypeConversion: '<S597>/Data Type Conversion6' */ |
| 21366 | |
| 21367 | /* DataTypeConversion: '<S597>/Data Type Conversion7' */ |
| 21368 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_p; |
| 21369 | if (PositionFinalLimited < 256.0) { |
| 21370 | if (PositionFinalLimited >= 0.0) { |
| 21371 | starting_index = (uint8_T)PositionFinalLimited; |
| 21372 | } else { |
| 21373 | starting_index = 0U; |
| 21374 | } |
| 21375 | } else { |
| 21376 | starting_index = MAX_uint8_T; |
| 21377 | } |
| 21378 | |
| 21379 | L4_MABX_B.DataTypeConversion7_j = starting_index; |
| 21380 | |
| 21381 | /* End of DataTypeConversion: '<S597>/Data Type Conversion7' */ |
| 21382 | |
| 21383 | /* MultiPortSwitch: '<S445>/Multiport_Switch' incorporates: |
| 21384 | * Constant: '<S445>/Constant' |
| 21385 | */ |
| 21386 | switch (PROPB_REAX_CHANNEL_APV) { |
| 21387 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 21388 | /* DataTypeConversion: '<S595>/Data Type Conversion' */ |
| 21389 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_ek; |
| 21390 | if (PositionFinalLimited < 256.0) { |
| 21391 | if (PositionFinalLimited >= 0.0) { |
| 21392 | starting_index = (uint8_T)PositionFinalLimited; |
| 21393 | } else { |
| 21394 | starting_index = 0U; |
| 21395 | } |
| 21396 | } else { |
| 21397 | starting_index = MAX_uint8_T; |
| 21398 | } |
| 21399 | |
| 21400 | L4_MABX_B.DataTypeConversion_nzt = starting_index; |
| 21401 | |
| 21402 | /* End of DataTypeConversion: '<S595>/Data Type Conversion' */ |
| 21403 | |
| 21404 | /* DataTypeConversion: '<S595>/Data Type Conversion1' */ |
| 21405 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_cf; |
| 21406 | if (PositionFinalLimited < 256.0) { |
| 21407 | if (PositionFinalLimited >= 0.0) { |
| 21408 | starting_index = (uint8_T)PositionFinalLimited; |
| 21409 | } else { |
| 21410 | starting_index = 0U; |
| 21411 | } |
| 21412 | } else { |
| 21413 | starting_index = MAX_uint8_T; |
| 21414 | } |
| 21415 | |
| 21416 | L4_MABX_B.DataTypeConversion1_ga = starting_index; |
| 21417 | |
| 21418 | /* End of DataTypeConversion: '<S595>/Data Type Conversion1' */ |
| 21419 | |
| 21420 | /* DataTypeConversion: '<S595>/Data Type Conversion2' */ |
| 21421 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_bl; |
| 21422 | if (PositionFinalLimited < 256.0) { |
| 21423 | if (PositionFinalLimited >= 0.0) { |
| 21424 | starting_index = (uint8_T)PositionFinalLimited; |
| 21425 | } else { |
| 21426 | starting_index = 0U; |
| 21427 | } |
| 21428 | } else { |
| 21429 | starting_index = MAX_uint8_T; |
| 21430 | } |
| 21431 | |
| 21432 | L4_MABX_B.DataTypeConversion2_nt = starting_index; |
| 21433 | |
| 21434 | /* End of DataTypeConversion: '<S595>/Data Type Conversion2' */ |
| 21435 | |
| 21436 | /* DataTypeConversion: '<S595>/Data Type Conversion3' */ |
| 21437 | PositionFinalLimited = L4_MABX_B.SFunction1_o4_p; |
| 21438 | if (PositionFinalLimited < 256.0) { |
| 21439 | if (PositionFinalLimited >= 0.0) { |
| 21440 | starting_index = (uint8_T)PositionFinalLimited; |
| 21441 | } else { |
| 21442 | starting_index = 0U; |
| 21443 | } |
| 21444 | } else { |
| 21445 | starting_index = MAX_uint8_T; |
| 21446 | } |
| 21447 | |
| 21448 | L4_MABX_B.DataTypeConversion3_lk = starting_index; |
| 21449 | |
| 21450 | /* End of DataTypeConversion: '<S595>/Data Type Conversion3' */ |
| 21451 | |
| 21452 | /* DataTypeConversion: '<S595>/Data Type Conversion4' */ |
| 21453 | PositionFinalLimited = L4_MABX_B.SFunction1_o5_ed; |
| 21454 | if (PositionFinalLimited < 256.0) { |
| 21455 | if (PositionFinalLimited >= 0.0) { |
| 21456 | starting_index = (uint8_T)PositionFinalLimited; |
| 21457 | } else { |
| 21458 | starting_index = 0U; |
| 21459 | } |
| 21460 | } else { |
| 21461 | starting_index = MAX_uint8_T; |
| 21462 | } |
| 21463 | |
| 21464 | L4_MABX_B.DataTypeConversion4_en = starting_index; |
| 21465 | |
| 21466 | /* End of DataTypeConversion: '<S595>/Data Type Conversion4' */ |
| 21467 | |
| 21468 | /* DataTypeConversion: '<S595>/Data Type Conversion5' */ |
| 21469 | PositionFinalLimited = L4_MABX_B.SFunction1_o6_c; |
| 21470 | if (PositionFinalLimited < 256.0) { |
| 21471 | if (PositionFinalLimited >= 0.0) { |
| 21472 | starting_index = (uint8_T)PositionFinalLimited; |
| 21473 | } else { |
| 21474 | starting_index = 0U; |
| 21475 | } |
| 21476 | } else { |
| 21477 | starting_index = MAX_uint8_T; |
| 21478 | } |
| 21479 | |
| 21480 | L4_MABX_B.DataTypeConversion5_c = starting_index; |
| 21481 | |
| 21482 | /* End of DataTypeConversion: '<S595>/Data Type Conversion5' */ |
| 21483 | |
| 21484 | /* DataTypeConversion: '<S595>/Data Type Conversion6' */ |
| 21485 | PositionFinalLimited = L4_MABX_B.SFunction1_o7_f; |
| 21486 | if (PositionFinalLimited < 256.0) { |
| 21487 | if (PositionFinalLimited >= 0.0) { |
| 21488 | starting_index = (uint8_T)PositionFinalLimited; |
| 21489 | } else { |
| 21490 | starting_index = 0U; |
| 21491 | } |
| 21492 | } else { |
| 21493 | starting_index = MAX_uint8_T; |
| 21494 | } |
| 21495 | |
| 21496 | L4_MABX_B.DataTypeConversion6_a = starting_index; |
| 21497 | |
| 21498 | /* End of DataTypeConversion: '<S595>/Data Type Conversion6' */ |
| 21499 | |
| 21500 | /* DataTypeConversion: '<S595>/Data Type Conversion7' */ |
| 21501 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_o; |
| 21502 | if (PositionFinalLimited < 256.0) { |
| 21503 | if (PositionFinalLimited >= 0.0) { |
| 21504 | starting_index = (uint8_T)PositionFinalLimited; |
| 21505 | } else { |
| 21506 | starting_index = 0U; |
| 21507 | } |
| 21508 | } else { |
| 21509 | starting_index = MAX_uint8_T; |
| 21510 | } |
| 21511 | |
| 21512 | L4_MABX_B.DataTypeConversion7_b = starting_index; |
| 21513 | |
| 21514 | /* End of DataTypeConversion: '<S595>/Data Type Conversion7' */ |
| 21515 | L4_MABX_B.RawData_k[0] = L4_MABX_B.DataTypeConversion_nzt; |
| 21516 | L4_MABX_B.RawData_k[1] = L4_MABX_B.DataTypeConversion1_ga; |
| 21517 | L4_MABX_B.RawData_k[2] = L4_MABX_B.DataTypeConversion2_nt; |
| 21518 | L4_MABX_B.RawData_k[3] = L4_MABX_B.DataTypeConversion3_lk; |
| 21519 | L4_MABX_B.RawData_k[4] = L4_MABX_B.DataTypeConversion4_en; |
| 21520 | L4_MABX_B.RawData_k[5] = L4_MABX_B.DataTypeConversion5_c; |
| 21521 | L4_MABX_B.RawData_k[6] = L4_MABX_B.DataTypeConversion6_a; |
| 21522 | L4_MABX_B.RawData_k[7] = L4_MABX_B.DataTypeConversion7_b; |
| 21523 | break; |
| 21524 | |
| 21525 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 21526 | /* DataTypeConversion: '<S596>/Data Type Conversion' */ |
| 21527 | PositionFinalLimited = L4_MABX_B.SFunction1_o1_km; |
| 21528 | if (PositionFinalLimited < 256.0) { |
| 21529 | if (PositionFinalLimited >= 0.0) { |
| 21530 | starting_index = (uint8_T)PositionFinalLimited; |
| 21531 | } else { |
| 21532 | starting_index = 0U; |
| 21533 | } |
| 21534 | } else { |
| 21535 | starting_index = MAX_uint8_T; |
| 21536 | } |
| 21537 | |
| 21538 | L4_MABX_B.DataTypeConversion_el = starting_index; |
| 21539 | |
| 21540 | /* End of DataTypeConversion: '<S596>/Data Type Conversion' */ |
| 21541 | |
| 21542 | /* DataTypeConversion: '<S596>/Data Type Conversion1' */ |
| 21543 | PositionFinalLimited = L4_MABX_B.SFunction1_o2_po; |
| 21544 | if (PositionFinalLimited < 256.0) { |
| 21545 | if (PositionFinalLimited >= 0.0) { |
| 21546 | starting_index = (uint8_T)PositionFinalLimited; |
| 21547 | } else { |
| 21548 | starting_index = 0U; |
| 21549 | } |
| 21550 | } else { |
| 21551 | starting_index = MAX_uint8_T; |
| 21552 | } |
| 21553 | |
| 21554 | L4_MABX_B.DataTypeConversion1_os = starting_index; |
| 21555 | |
| 21556 | /* End of DataTypeConversion: '<S596>/Data Type Conversion1' */ |
| 21557 | |
| 21558 | /* DataTypeConversion: '<S596>/Data Type Conversion2' */ |
| 21559 | PositionFinalLimited = L4_MABX_B.SFunction1_o3_mb; |
| 21560 | if (PositionFinalLimited < 256.0) { |
| 21561 | if (PositionFinalLimited >= 0.0) { |
| 21562 | starting_index = (uint8_T)PositionFinalLimited; |
| 21563 | } else { |
| 21564 | starting_index = 0U; |
| 21565 | } |
| 21566 | } else { |
| 21567 | starting_index = MAX_uint8_T; |
| 21568 | } |
| 21569 | |
| 21570 | L4_MABX_B.DataTypeConversion2_du = starting_index; |
| 21571 | |
| 21572 | /* End of DataTypeConversion: '<S596>/Data Type Conversion2' */ |
| 21573 | |
| 21574 | /* DataTypeConversion: '<S596>/Data Type Conversion3' */ |
| 21575 | PositionFinalLimited = L4_MABX_B.SFunction1_o4_m4; |
| 21576 | if (PositionFinalLimited < 256.0) { |
| 21577 | if (PositionFinalLimited >= 0.0) { |
| 21578 | starting_index = (uint8_T)PositionFinalLimited; |
| 21579 | } else { |
| 21580 | starting_index = 0U; |
| 21581 | } |
| 21582 | } else { |
| 21583 | starting_index = MAX_uint8_T; |
| 21584 | } |
| 21585 | |
| 21586 | L4_MABX_B.DataTypeConversion3_f = starting_index; |
| 21587 | |
| 21588 | /* End of DataTypeConversion: '<S596>/Data Type Conversion3' */ |
| 21589 | |
| 21590 | /* DataTypeConversion: '<S596>/Data Type Conversion4' */ |
| 21591 | PositionFinalLimited = L4_MABX_B.SFunction1_o5_ac; |
| 21592 | if (PositionFinalLimited < 256.0) { |
| 21593 | if (PositionFinalLimited >= 0.0) { |
| 21594 | starting_index = (uint8_T)PositionFinalLimited; |
| 21595 | } else { |
| 21596 | starting_index = 0U; |
| 21597 | } |
| 21598 | } else { |
| 21599 | starting_index = MAX_uint8_T; |
| 21600 | } |
| 21601 | |
| 21602 | L4_MABX_B.DataTypeConversion4_iz = starting_index; |
| 21603 | |
| 21604 | /* End of DataTypeConversion: '<S596>/Data Type Conversion4' */ |
| 21605 | |
| 21606 | /* DataTypeConversion: '<S596>/Data Type Conversion5' */ |
| 21607 | PositionFinalLimited = L4_MABX_B.SFunction1_o6_kg; |
| 21608 | if (PositionFinalLimited < 256.0) { |
| 21609 | if (PositionFinalLimited >= 0.0) { |
| 21610 | starting_index = (uint8_T)PositionFinalLimited; |
| 21611 | } else { |
| 21612 | starting_index = 0U; |
| 21613 | } |
| 21614 | } else { |
| 21615 | starting_index = MAX_uint8_T; |
| 21616 | } |
| 21617 | |
| 21618 | L4_MABX_B.DataTypeConversion5_id = starting_index; |
| 21619 | |
| 21620 | /* End of DataTypeConversion: '<S596>/Data Type Conversion5' */ |
| 21621 | |
| 21622 | /* DataTypeConversion: '<S596>/Data Type Conversion6' */ |
| 21623 | PositionFinalLimited = L4_MABX_B.SFunction1_o7_ow; |
| 21624 | if (PositionFinalLimited < 256.0) { |
| 21625 | if (PositionFinalLimited >= 0.0) { |
| 21626 | starting_index = (uint8_T)PositionFinalLimited; |
| 21627 | } else { |
| 21628 | starting_index = 0U; |
| 21629 | } |
| 21630 | } else { |
| 21631 | starting_index = MAX_uint8_T; |
| 21632 | } |
| 21633 | |
| 21634 | L4_MABX_B.DataTypeConversion6_gd = starting_index; |
| 21635 | |
| 21636 | /* End of DataTypeConversion: '<S596>/Data Type Conversion6' */ |
| 21637 | |
| 21638 | /* DataTypeConversion: '<S596>/Data Type Conversion7' */ |
| 21639 | PositionFinalLimited = L4_MABX_B.SFunction1_o8_n1; |
| 21640 | if (PositionFinalLimited < 256.0) { |
| 21641 | if (PositionFinalLimited >= 0.0) { |
| 21642 | starting_index = (uint8_T)PositionFinalLimited; |
| 21643 | } else { |
| 21644 | starting_index = 0U; |
| 21645 | } |
| 21646 | } else { |
| 21647 | starting_index = MAX_uint8_T; |
| 21648 | } |
| 21649 | |
| 21650 | L4_MABX_B.DataTypeConversion7_mah = starting_index; |
| 21651 | |
| 21652 | /* End of DataTypeConversion: '<S596>/Data Type Conversion7' */ |
| 21653 | L4_MABX_B.RawData_k[0] = L4_MABX_B.DataTypeConversion_el; |
| 21654 | L4_MABX_B.RawData_k[1] = L4_MABX_B.DataTypeConversion1_os; |
| 21655 | L4_MABX_B.RawData_k[2] = L4_MABX_B.DataTypeConversion2_du; |
| 21656 | L4_MABX_B.RawData_k[3] = L4_MABX_B.DataTypeConversion3_f; |
| 21657 | L4_MABX_B.RawData_k[4] = L4_MABX_B.DataTypeConversion4_iz; |
| 21658 | L4_MABX_B.RawData_k[5] = L4_MABX_B.DataTypeConversion5_id; |
| 21659 | L4_MABX_B.RawData_k[6] = L4_MABX_B.DataTypeConversion6_gd; |
| 21660 | L4_MABX_B.RawData_k[7] = L4_MABX_B.DataTypeConversion7_mah; |
| 21661 | break; |
| 21662 | |
| 21663 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 21664 | L4_MABX_B.RawData_k[0] = L4_MABX_B.DataTypeConversion_lm; |
| 21665 | L4_MABX_B.RawData_k[1] = L4_MABX_B.DataTypeConversion1_fb; |
| 21666 | L4_MABX_B.RawData_k[2] = L4_MABX_B.DataTypeConversion2_bv; |
| 21667 | L4_MABX_B.RawData_k[3] = L4_MABX_B.DataTypeConversion3_n2; |
| 21668 | L4_MABX_B.RawData_k[4] = L4_MABX_B.DataTypeConversion4_ir; |
| 21669 | L4_MABX_B.RawData_k[5] = L4_MABX_B.DataTypeConversion5_e3; |
| 21670 | L4_MABX_B.RawData_k[6] = L4_MABX_B.DataTypeConversion6_fqb; |
| 21671 | L4_MABX_B.RawData_k[7] = L4_MABX_B.DataTypeConversion7_j; |
| 21672 | break; |
| 21673 | |
| 21674 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 21675 | L4_MABX_B.RawData_k[0] = L4_MABX_B.DataTypeConversion_lm; |
| 21676 | L4_MABX_B.RawData_k[1] = L4_MABX_B.DataTypeConversion1_fb; |
| 21677 | L4_MABX_B.RawData_k[2] = L4_MABX_B.DataTypeConversion2_bv; |
| 21678 | L4_MABX_B.RawData_k[3] = L4_MABX_B.DataTypeConversion3_n2; |
| 21679 | L4_MABX_B.RawData_k[4] = L4_MABX_B.DataTypeConversion4_ir; |
| 21680 | L4_MABX_B.RawData_k[5] = L4_MABX_B.DataTypeConversion5_e3; |
| 21681 | L4_MABX_B.RawData_k[6] = L4_MABX_B.DataTypeConversion6_fqb; |
| 21682 | L4_MABX_B.RawData_k[7] = L4_MABX_B.DataTypeConversion7_j; |
| 21683 | break; |
| 21684 | |
| 21685 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 21686 | L4_MABX_B.RawData_k[0] = L4_MABX_B.DataTypeConversion_lm; |
| 21687 | L4_MABX_B.RawData_k[1] = L4_MABX_B.DataTypeConversion1_fb; |
| 21688 | L4_MABX_B.RawData_k[2] = L4_MABX_B.DataTypeConversion2_bv; |
| 21689 | L4_MABX_B.RawData_k[3] = L4_MABX_B.DataTypeConversion3_n2; |
| 21690 | L4_MABX_B.RawData_k[4] = L4_MABX_B.DataTypeConversion4_ir; |
| 21691 | L4_MABX_B.RawData_k[5] = L4_MABX_B.DataTypeConversion5_e3; |
| 21692 | L4_MABX_B.RawData_k[6] = L4_MABX_B.DataTypeConversion6_fqb; |
| 21693 | L4_MABX_B.RawData_k[7] = L4_MABX_B.DataTypeConversion7_j; |
| 21694 | break; |
| 21695 | |
| 21696 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 21697 | L4_MABX_B.RawData_k[0] = L4_MABX_B.DataTypeConversion_lm; |
| 21698 | L4_MABX_B.RawData_k[1] = L4_MABX_B.DataTypeConversion1_fb; |
| 21699 | L4_MABX_B.RawData_k[2] = L4_MABX_B.DataTypeConversion2_bv; |
| 21700 | L4_MABX_B.RawData_k[3] = L4_MABX_B.DataTypeConversion3_n2; |
| 21701 | L4_MABX_B.RawData_k[4] = L4_MABX_B.DataTypeConversion4_ir; |
| 21702 | L4_MABX_B.RawData_k[5] = L4_MABX_B.DataTypeConversion5_e3; |
| 21703 | L4_MABX_B.RawData_k[6] = L4_MABX_B.DataTypeConversion6_fqb; |
| 21704 | L4_MABX_B.RawData_k[7] = L4_MABX_B.DataTypeConversion7_j; |
| 21705 | break; |
| 21706 | |
| 21707 | default: |
| 21708 | L4_MABX_B.RawData_k[0] = L4_MABX_B.DataTypeConversion_lm; |
| 21709 | L4_MABX_B.RawData_k[1] = L4_MABX_B.DataTypeConversion1_fb; |
| 21710 | L4_MABX_B.RawData_k[2] = L4_MABX_B.DataTypeConversion2_bv; |
| 21711 | L4_MABX_B.RawData_k[3] = L4_MABX_B.DataTypeConversion3_n2; |
| 21712 | L4_MABX_B.RawData_k[4] = L4_MABX_B.DataTypeConversion4_ir; |
| 21713 | L4_MABX_B.RawData_k[5] = L4_MABX_B.DataTypeConversion5_e3; |
| 21714 | L4_MABX_B.RawData_k[6] = L4_MABX_B.DataTypeConversion6_fqb; |
| 21715 | L4_MABX_B.RawData_k[7] = L4_MABX_B.DataTypeConversion7_j; |
| 21716 | break; |
| 21717 | } |
| 21718 | |
| 21719 | /* S-Function (sfix_bitop): '<S684>/Operator' */ |
| 21720 | L4_MABX_B.Operator_aw = (uint8_T)(L4_MABX_B.RawData_k[0] & |
| 21721 | L4_MABX_P.Operator_BitMask_ko); |
| 21722 | |
| 21723 | /* DataTypeConversion: '<S684>/DataType' */ |
| 21724 | L4_MABX_B.DataType_ij = L4_MABX_B.Operator_aw; |
| 21725 | |
| 21726 | /* ArithShift: '<S677>/Shift_Arithmetic ' */ |
| 21727 | L4_MABX_B.Shift_Arithmetic_d = (uint8_T)((uint32_T)L4_MABX_B.DataType_ij >> 1); |
| 21728 | |
| 21729 | /* DataTypeConversion: '<S677>/Data Type Conversion' */ |
| 21730 | L4_MABX_B.PropB_REAX_4_PositionIndexValid = (L4_MABX_B.Shift_Arithmetic_d != 0); |
| 21731 | |
| 21732 | /* DataTypeConversion: '<S420>/Data Type Conversion' */ |
| 21733 | L4_MABX_B.DataTypeConversion_ob = L4_MABX_B.PropB_REAX_4_PositionIndexValid; |
| 21734 | |
| 21735 | /* S-Function (sfix_bitop): '<S683>/Operator' */ |
| 21736 | L4_MABX_B.Operator_ex = (uint8_T)(L4_MABX_B.RawData_k[0] & |
| 21737 | L4_MABX_P.Operator_BitMask_kx); |
| 21738 | |
| 21739 | /* DataTypeConversion: '<S683>/DataType' */ |
| 21740 | L4_MABX_B.DataType_ch = (L4_MABX_B.Operator_ex != 0); |
| 21741 | |
| 21742 | /* DataTypeConversion: '<S420>/Data Type Conversion1' */ |
| 21743 | L4_MABX_B.DataTypeConversion1_gg = L4_MABX_B.DataType_ch; |
| 21744 | |
| 21745 | /* S-Function (sfix_bitop): '<S685>/Operator' */ |
| 21746 | L4_MABX_B.Operator_ol = (uint8_T)(L4_MABX_B.RawData_k[0] & |
| 21747 | L4_MABX_P.Operator_BitMask_hi); |
| 21748 | |
| 21749 | /* DataTypeConversion: '<S685>/DataType' */ |
| 21750 | L4_MABX_B.DataType_af = L4_MABX_B.Operator_ol; |
| 21751 | |
| 21752 | /* ArithShift: '<S677>/Shift_Arithmetic 1' */ |
| 21753 | L4_MABX_B.Shift_Arithmetic1_gt = (uint8_T)((uint32_T)L4_MABX_B.DataType_af >> |
| 21754 | 2); |
| 21755 | |
| 21756 | /* DataTypeConversion: '<S677>/Data Type Conversion1' */ |
| 21757 | L4_MABX_B.PropB_REAX_4_DriverControlledEf = (L4_MABX_B.Shift_Arithmetic1_gt != |
| 21758 | 0); |
| 21759 | |
| 21760 | /* DataTypeConversion: '<S420>/Data Type Conversion2' */ |
| 21761 | L4_MABX_B.DataTypeConversion2_jq = L4_MABX_B.PropB_REAX_4_DriverControlledEf; |
| 21762 | |
| 21763 | /* SignalConversion: '<S678>/SignalConversion' */ |
| 21764 | L4_MABX_B.PropB_REAX_4_ControlOperatingMo = L4_MABX_B.RawData_k[1]; |
| 21765 | |
| 21766 | /* DataTypeConversion: '<S420>/Data Type Conversion3' */ |
| 21767 | L4_MABX_B.DataTypeConversion3_e = L4_MABX_B.PropB_REAX_4_ControlOperatingMo; |
| 21768 | |
| 21769 | /* SignalConversion: '<S679>/SignalConversion' */ |
| 21770 | L4_MABX_B.PropB_REAX_4_SystemMode = L4_MABX_B.RawData_k[2]; |
| 21771 | |
| 21772 | /* DataTypeConversion: '<S420>/Data Type Conversion4' */ |
| 21773 | L4_MABX_B.DataTypeConversion4_j = L4_MABX_B.PropB_REAX_4_SystemMode; |
| 21774 | |
| 21775 | /* DataTypeConversion: '<S680>/Data Type Conversion4' */ |
| 21776 | L4_MABX_B.DataTypeConversion4_ku = (int8_T)L4_MABX_B.RawData_k[4]; |
| 21777 | |
| 21778 | /* DataTypeConversion: '<S680>/Data Type Conversion5' */ |
| 21779 | L4_MABX_B.PropB_REAX_4_PercHandwheelTorqu = L4_MABX_B.DataTypeConversion4_ku; |
| 21780 | |
| 21781 | /* DataTypeConversion: '<S420>/Data Type Conversion5' */ |
| 21782 | L4_MABX_B.DataTypeConversion5_k = L4_MABX_B.PropB_REAX_4_PercHandwheelTorqu; |
| 21783 | |
| 21784 | /* DataTypeConversion: '<S681>/Data Type Conversion6' */ |
| 21785 | L4_MABX_B.DataTypeConversion6_c = L4_MABX_B.RawData_k[5]; |
| 21786 | |
| 21787 | /* DataTypeConversion: '<S681>/Data Type Conversion7' */ |
| 21788 | L4_MABX_B.DataTypeConversion7_k5 = L4_MABX_B.RawData_k[6]; |
| 21789 | |
| 21790 | /* ArithShift: '<S681>/Shift_Arithmetic 2' */ |
| 21791 | L4_MABX_B.Shift_Arithmetic2_b = (uint16_T)(L4_MABX_B.DataTypeConversion7_k5 << |
| 21792 | 8); |
| 21793 | |
| 21794 | /* S-Function (sfix_bitop): '<S686>/Operator' */ |
| 21795 | L4_MABX_B.Operator_cb = (uint16_T)(L4_MABX_B.DataTypeConversion6_c | |
| 21796 | L4_MABX_B.Shift_Arithmetic2_b); |
| 21797 | |
| 21798 | /* DataTypeConversion: '<S686>/DataType' */ |
| 21799 | L4_MABX_B.DataType_ko = L4_MABX_B.Operator_cb; |
| 21800 | |
| 21801 | /* DataTypeConversion: '<S681>/Data Type Conversion8' */ |
| 21802 | L4_MABX_B.DataTypeConversion8_b = (int16_T)L4_MABX_B.DataType_ko; |
| 21803 | |
| 21804 | /* DataTypeConversion: '<S681>/Data Type Conversion9' */ |
| 21805 | L4_MABX_B.PropB_REAX_4_AbsSteeringAngle = L4_MABX_B.DataTypeConversion8_b; |
| 21806 | |
| 21807 | /* DataTypeConversion: '<S420>/Data Type Conversion6' */ |
| 21808 | L4_MABX_B.DataTypeConversion6_p = L4_MABX_B.PropB_REAX_4_AbsSteeringAngle; |
| 21809 | |
| 21810 | /* DataTypeConversion: '<S682>/Data Type Conversion10' */ |
| 21811 | L4_MABX_B.DataTypeConversion10_hb = (int8_T)L4_MABX_B.RawData_k[7]; |
| 21812 | |
| 21813 | /* DataTypeConversion: '<S682>/Data Type Conversion11' */ |
| 21814 | L4_MABX_B.PropB_REAX_4_PercMotorTorque = L4_MABX_B.DataTypeConversion10_hb; |
| 21815 | |
| 21816 | /* DataTypeConversion: '<S420>/Data Type Conversion7' */ |
| 21817 | L4_MABX_B.DataTypeConversion7_p = L4_MABX_B.PropB_REAX_4_PercMotorTorque; |
| 21818 | |
| 21819 | /* DataTypeConversion: '<S597>/Data Type Conversion8' */ |
| 21820 | L4_MABX_B.RX_status_gk = (L4_MABX_B.SFunction1_o9_on != 0.0); |
| 21821 | |
| 21822 | /* MultiPortSwitch: '<S445>/Multiport_Switch' incorporates: |
| 21823 | * Constant: '<S445>/Constant' |
| 21824 | */ |
| 21825 | switch (PROPB_REAX_CHANNEL_APV) { |
| 21826 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 21827 | /* DataTypeConversion: '<S595>/Data Type Conversion8' */ |
| 21828 | L4_MABX_B.RX_status_kp = (L4_MABX_B.SFunction1_o9_d != 0.0); |
| 21829 | L4_MABX_B.RX_status_oh = L4_MABX_B.RX_status_kp; |
| 21830 | break; |
| 21831 | |
| 21832 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 21833 | /* DataTypeConversion: '<S596>/Data Type Conversion8' */ |
| 21834 | L4_MABX_B.RX_status_nr = (L4_MABX_B.SFunction1_o9_c != 0.0); |
| 21835 | L4_MABX_B.RX_status_oh = L4_MABX_B.RX_status_nr; |
| 21836 | break; |
| 21837 | |
| 21838 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 21839 | L4_MABX_B.RX_status_oh = L4_MABX_B.RX_status_gk; |
| 21840 | break; |
| 21841 | |
| 21842 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 21843 | L4_MABX_B.RX_status_oh = L4_MABX_B.RX_status_gk; |
| 21844 | break; |
| 21845 | |
| 21846 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 21847 | L4_MABX_B.RX_status_oh = L4_MABX_B.RX_status_gk; |
| 21848 | break; |
| 21849 | |
| 21850 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 21851 | L4_MABX_B.RX_status_oh = L4_MABX_B.RX_status_gk; |
| 21852 | break; |
| 21853 | |
| 21854 | default: |
| 21855 | L4_MABX_B.RX_status_oh = L4_MABX_B.RX_status_gk; |
| 21856 | break; |
| 21857 | } |
| 21858 | |
| 21859 | /* DataTypeConversion: '<S597>/Data Type Conversion9' */ |
| 21860 | L4_MABX_B.RX_time_n0 = L4_MABX_B.SFunction1_o10_of; |
| 21861 | |
| 21862 | /* MultiPortSwitch: '<S445>/Multiport_Switch' incorporates: |
| 21863 | * Constant: '<S445>/Constant' |
| 21864 | */ |
| 21865 | switch (PROPB_REAX_CHANNEL_APV) { |
| 21866 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 21867 | /* DataTypeConversion: '<S595>/Data Type Conversion9' */ |
| 21868 | L4_MABX_B.RX_time_f = L4_MABX_B.SFunction1_o10_g; |
| 21869 | L4_MABX_B.RX_time_jm = L4_MABX_B.RX_time_f; |
| 21870 | break; |
| 21871 | |
| 21872 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 21873 | /* DataTypeConversion: '<S596>/Data Type Conversion9' */ |
| 21874 | L4_MABX_B.RX_time_dq = L4_MABX_B.SFunction1_o10_c; |
| 21875 | L4_MABX_B.RX_time_jm = L4_MABX_B.RX_time_dq; |
| 21876 | break; |
| 21877 | |
| 21878 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 21879 | L4_MABX_B.RX_time_jm = L4_MABX_B.RX_time_n0; |
| 21880 | break; |
| 21881 | |
| 21882 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 21883 | L4_MABX_B.RX_time_jm = L4_MABX_B.RX_time_n0; |
| 21884 | break; |
| 21885 | |
| 21886 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 21887 | L4_MABX_B.RX_time_jm = L4_MABX_B.RX_time_n0; |
| 21888 | break; |
| 21889 | |
| 21890 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 21891 | L4_MABX_B.RX_time_jm = L4_MABX_B.RX_time_n0; |
| 21892 | break; |
| 21893 | |
| 21894 | default: |
| 21895 | L4_MABX_B.RX_time_jm = L4_MABX_B.RX_time_n0; |
| 21896 | break; |
| 21897 | } |
| 21898 | |
| 21899 | /* DataTypeConversion: '<S597>/Data Type Conversion10' */ |
| 21900 | L4_MABX_B.RX_delta_time_he = L4_MABX_B.SFunction1_o11_d; |
| 21901 | |
| 21902 | /* MultiPortSwitch: '<S445>/Multiport_Switch' incorporates: |
| 21903 | * Constant: '<S445>/Constant' |
| 21904 | */ |
| 21905 | switch (PROPB_REAX_CHANNEL_APV) { |
| 21906 | case ENUM_CAN_RX_T_RX_CAN_1: |
| 21907 | /* DataTypeConversion: '<S595>/Data Type Conversion10' */ |
| 21908 | L4_MABX_B.RX_delta_time_c2 = L4_MABX_B.SFunction1_o11_k; |
| 21909 | L4_MABX_B.RX_delta_time_an = L4_MABX_B.RX_delta_time_c2; |
| 21910 | break; |
| 21911 | |
| 21912 | case ENUM_CAN_RX_T_RX_CAN_2: |
| 21913 | /* DataTypeConversion: '<S596>/Data Type Conversion10' */ |
| 21914 | L4_MABX_B.RX_delta_time_bs = L4_MABX_B.SFunction1_o11_o; |
| 21915 | L4_MABX_B.RX_delta_time_an = L4_MABX_B.RX_delta_time_bs; |
| 21916 | break; |
| 21917 | |
| 21918 | case ENUM_CAN_RX_T_RX_CAN_3: |
| 21919 | L4_MABX_B.RX_delta_time_an = L4_MABX_B.RX_delta_time_he; |
| 21920 | break; |
| 21921 | |
| 21922 | case ENUM_CAN_RX_T_RX_CAN_4: |
| 21923 | L4_MABX_B.RX_delta_time_an = L4_MABX_B.RX_delta_time_he; |
| 21924 | break; |
| 21925 | |
| 21926 | case ENUM_CAN_RX_T_RX_CAN_5: |
| 21927 | L4_MABX_B.RX_delta_time_an = L4_MABX_B.RX_delta_time_he; |
| 21928 | break; |
| 21929 | |
| 21930 | case ENUM_CAN_RX_T_RX_CAN_6: |
| 21931 | L4_MABX_B.RX_delta_time_an = L4_MABX_B.RX_delta_time_he; |
| 21932 | break; |
| 21933 | |
| 21934 | default: |
| 21935 | L4_MABX_B.RX_delta_time_an = L4_MABX_B.RX_delta_time_he; |
| 21936 | break; |
| 21937 | } |
| 21938 | |
| 21939 | /* RelationalOperator: '<S604>/Operator' incorporates: |
| 21940 | * Constant: '<S445>/Constant' |
| 21941 | * Constant: '<S598>/Constant2' |
| 21942 | */ |
| 21943 | L4_MABX_B.Operator_iz = (PROPB_REAX_CHANNEL_APV == L4_MABX_P.Constant2_Value_k); |
| 21944 | |
| 21945 | /* RelationalOperator: '<S605>/Operator' incorporates: |
| 21946 | * Constant: '<S445>/Constant' |
| 21947 | * Constant: '<S598>/Constant3' |
| 21948 | */ |
| 21949 | L4_MABX_B.Operator_dw = (PROPB_REAX_CHANNEL_APV == |
| 21950 | L4_MABX_P.Constant3_Value_jg); |
| 21951 | |
| 21952 | /* RelationalOperator: '<S606>/Operator' incorporates: |
| 21953 | * Constant: '<S445>/Constant' |
| 21954 | * Constant: '<S598>/Constant4' |
| 21955 | */ |
| 21956 | L4_MABX_B.Operator_gz = (PROPB_REAX_CHANNEL_APV == L4_MABX_P.Constant4_Value_h); |
| 21957 | |
| 21958 | /* S-Function (rti_commonblock): '<S460>/S-Function1' */ |
| 21959 | /* This comment workarounds a code generation problem */ |
| 21960 | |
| 21961 | /* S-Function (rti_commonblock): '<S461>/S-Function1' */ |
| 21962 | /* This comment workarounds a code generation problem */ |
| 21963 | |
| 21964 | /* S-Function (rti_commonblock): '<S462>/S-Function1' */ |
| 21965 | /* This comment workarounds a code generation problem */ |
| 21966 | |
| 21967 | /* S-Function (rti_commonblock): '<S463>/S-Function1' */ |
| 21968 | /* This comment workarounds a code generation problem */ |
| 21969 | |
| 21970 | /* S-Function (rti_commonblock): '<S464>/S-Function1' */ |
| 21971 | /* This comment workarounds a code generation problem */ |
| 21972 | |
| 21973 | /* S-Function (rti_commonblock): '<S465>/S-Function1' */ |
| 21974 | /* This comment workarounds a code generation problem */ |
| 21975 | |
| 21976 | /* S-Function (rti_commonblock): '<S737>/S-Function1' */ |
| 21977 | /* This comment workarounds a code generation problem */ |
| 21978 | |
| 21979 | /* DataTypeConversion: '<S416>/LogPbActive' */ |
| 21980 | L4_MABX_B.LogPbActive = L4_MABX_B.SFunction1_e; |
| 21981 | |
| 21982 | /* Logic: '<S416>/Logical Operator2' */ |
| 21983 | L4_MABX_B.LogicalOperator2_l = !L4_MABX_B.LogPbActive; |
| 21984 | |
| 21985 | /* RelationalOperator: '<S751>/Compare' incorporates: |
| 21986 | * Constant: '<S751>/Constant' |
| 21987 | */ |
| 21988 | L4_MABX_B.Compare_ks = ((int32_T)L4_MABX_B.LogicalOperator2_l > (int32_T) |
| 21989 | L4_MABX_P.Constant_Value_gu); |
| 21990 | |
| 21991 | /* UnitDelay: '<S747>/Delay Input1' */ |
| 21992 | L4_MABX_B.Uk1_k2 = L4_MABX_DW.DelayInput1_DSTATE_b; |
| 21993 | |
| 21994 | /* RelationalOperator: '<S747>/FixPt Relational Operator' */ |
| 21995 | L4_MABX_B.FixPtRelationalOperator_h = ((int32_T)L4_MABX_B.Compare_ks > |
| 21996 | (int32_T)L4_MABX_B.Uk1_k2); |
| 21997 | |
| 21998 | /* UnitDelay: '<S748>/Unit Delay' */ |
| 21999 | L4_MABX_B.UnitDelay_i = L4_MABX_DW.UnitDelay_DSTATE_d; |
| 22000 | |
| 22001 | /* UnitDelay: '<S742>/Unit Delay' */ |
| 22002 | L4_MABX_B.UnitDelay_op = L4_MABX_DW.UnitDelay_DSTATE_ig; |
| 22003 | |
| 22004 | /* RelationalOperator: '<S750>/Compare' incorporates: |
| 22005 | * Constant: '<S750>/Constant' |
| 22006 | */ |
| 22007 | L4_MABX_B.Compare_go = ((int32_T)L4_MABX_B.UnitDelay_op <= (int32_T) |
| 22008 | L4_MABX_P.Constant_Value_jcp); |
| 22009 | |
| 22010 | /* UnitDelay: '<S746>/Delay Input1' */ |
| 22011 | L4_MABX_B.Uk1_p = L4_MABX_DW.DelayInput1_DSTATE_fl; |
| 22012 | |
| 22013 | /* RelationalOperator: '<S746>/FixPt Relational Operator' */ |
| 22014 | L4_MABX_B.FixPtRelationalOperator_ge = ((int32_T)L4_MABX_B.Compare_go > |
| 22015 | (int32_T)L4_MABX_B.Uk1_p); |
| 22016 | |
| 22017 | /* UnitDelay: '<S748>/Unit Delay1' */ |
| 22018 | L4_MABX_B.UnitDelay1_g3 = L4_MABX_DW.UnitDelay1_DSTATE_m0; |
| 22019 | |
| 22020 | /* Logic: '<S748>/OR1' */ |
| 22021 | L4_MABX_B.OR1_e = (L4_MABX_B.FixPtRelationalOperator_ge || |
| 22022 | L4_MABX_B.UnitDelay1_g3); |
| 22023 | |
| 22024 | /* Switch: '<S748>/Switch' incorporates: |
| 22025 | * Constant: '<S748>/Constant0' |
| 22026 | */ |
| 22027 | if (L4_MABX_B.OR1_e) { |
| 22028 | /* Sum: '<S748>/Sum' incorporates: |
| 22029 | * Constant: '<S748>/Constant1' |
| 22030 | */ |
| 22031 | L4_MABX_B.Sum_o = L4_MABX_B.UnitDelay_i + L4_MABX_P.Constant1_Value_pt; |
| 22032 | L4_MABX_B.Switch_p1 = L4_MABX_B.Sum_o; |
| 22033 | } else { |
| 22034 | L4_MABX_B.Switch_p1 = L4_MABX_P.Constant0_Value_f; |
| 22035 | } |
| 22036 | |
| 22037 | /* End of Switch: '<S748>/Switch' */ |
| 22038 | |
| 22039 | /* RelationalOperator: '<S752>/Compare' incorporates: |
| 22040 | * Constant: '<S752>/Constant' |
| 22041 | */ |
| 22042 | L4_MABX_B.Compare_lr = (L4_MABX_B.Switch_p1 > L4_MABX_P.Constant_Value_pn); |
| 22043 | |
| 22044 | /* Gain: '<S748>/Gain' incorporates: |
| 22045 | * Constant: '<S416>/Constant1' |
| 22046 | */ |
| 22047 | L4_MABX_B.Gain_l = L4_MABX_P.Gain_Gain_jk * L4_MABX_P.Constant1_Value_h3; |
| 22048 | |
| 22049 | /* RelationalOperator: '<S748>/LessThanOrEqual' */ |
| 22050 | L4_MABX_B.LessThanOrEqual_g = (L4_MABX_B.Switch_p1 <= L4_MABX_B.Gain_l); |
| 22051 | |
| 22052 | /* Logic: '<S748>/AND' */ |
| 22053 | L4_MABX_B.AND_n = (L4_MABX_B.Compare_lr && L4_MABX_B.LessThanOrEqual_g); |
| 22054 | |
| 22055 | /* Logic: '<S742>/NOT' */ |
| 22056 | L4_MABX_B.NOT_j = !L4_MABX_B.AND_n; |
| 22057 | |
| 22058 | /* Logic: '<S742>/AND' */ |
| 22059 | L4_MABX_B.AND_j = (L4_MABX_B.FixPtRelationalOperator_h && L4_MABX_B.NOT_j); |
| 22060 | |
| 22061 | /* UnitDelay: '<S749>/Unit Delay' */ |
| 22062 | L4_MABX_B.UnitDelay_m = L4_MABX_DW.UnitDelay_DSTATE_e; |
| 22063 | |
| 22064 | /* UnitDelay: '<S749>/Unit Delay1' */ |
| 22065 | L4_MABX_B.UnitDelay1_c = L4_MABX_DW.UnitDelay1_DSTATE_l; |
| 22066 | |
| 22067 | /* Logic: '<S749>/OR1' */ |
| 22068 | L4_MABX_B.OR1_a = (L4_MABX_B.AND_j || L4_MABX_B.UnitDelay1_c); |
| 22069 | |
| 22070 | /* Switch: '<S749>/Switch' incorporates: |
| 22071 | * Constant: '<S749>/Constant0' |
| 22072 | */ |
| 22073 | if (L4_MABX_B.OR1_a) { |
| 22074 | /* Sum: '<S749>/Sum' incorporates: |
| 22075 | * Constant: '<S749>/Constant1' |
| 22076 | */ |
| 22077 | L4_MABX_B.Sum_d = L4_MABX_B.UnitDelay_m + L4_MABX_P.Constant1_Value_h; |
| 22078 | L4_MABX_B.Switch_e = L4_MABX_B.Sum_d; |
| 22079 | } else { |
| 22080 | L4_MABX_B.Switch_e = L4_MABX_P.Constant0_Value_i; |
| 22081 | } |
| 22082 | |
| 22083 | /* End of Switch: '<S749>/Switch' */ |
| 22084 | |
| 22085 | /* RelationalOperator: '<S753>/Compare' incorporates: |
| 22086 | * Constant: '<S753>/Constant' |
| 22087 | */ |
| 22088 | L4_MABX_B.Compare_ei = (L4_MABX_B.Switch_e > L4_MABX_P.Constant_Value_pi); |
| 22089 | |
| 22090 | /* Gain: '<S749>/Gain' incorporates: |
| 22091 | * Constant: '<S416>/Constant' |
| 22092 | */ |
| 22093 | L4_MABX_B.Gain_d = L4_MABX_P.Gain_Gain_eu * L4_MABX_P.Constant_Value_gd; |
| 22094 | |
| 22095 | /* RelationalOperator: '<S749>/LessThanOrEqual' */ |
| 22096 | L4_MABX_B.LessThanOrEqual_i = (L4_MABX_B.Switch_e <= L4_MABX_B.Gain_d); |
| 22097 | |
| 22098 | /* Logic: '<S749>/AND' */ |
| 22099 | L4_MABX_B.AND_fp = (L4_MABX_B.Compare_ei && L4_MABX_B.LessThanOrEqual_i); |
| 22100 | |
| 22101 | /* Logic: '<S742>/AND2' */ |
| 22102 | LogEventPB = (L4_MABX_B.AND_fp && L4_MABX_B.NOT_j); |
| 22103 | |
| 22104 | /* Assertion: '<S783>/Assertion' */ |
| 22105 | utAssert(L4_MABX_B.conjunction_e); |
| 22106 | |
| 22107 | /* Assertion: '<S791>/Assertion' */ |
| 22108 | utAssert(L4_MABX_B.conjunction); |
| 22109 | |
| 22110 | /* Assertion: '<S799>/Assertion' */ |
| 22111 | utAssert(L4_MABX_B.conjunction_c); |
| 22112 | |
| 22113 | /* Assertion: '<S807>/Assertion' */ |
| 22114 | utAssert(L4_MABX_B.conjunction_g); |
| 22115 | |
| 22116 | /* Assertion: '<S815>/Assertion' */ |
| 22117 | utAssert(L4_MABX_B.conjunction_i); |
| 22118 | |
| 22119 | /* RelationalOperator: '<S782>/Relational Operator9' incorporates: |
| 22120 | * Constant: '<S763>/PWMSynchFaultLimMin' |
| 22121 | */ |
| 22122 | L4_MABX_B.F_Fault_Soft_e = (L4_MABX_B.If_Then_Else_k2.Switch != |
| 22123 | L4_MABX_P.PWMSynchFaultLimMin_Value); |
| 22124 | |
| 22125 | /* Gain: '<S416>/ShifterControlFreq' */ |
| 22126 | L4_MABX_B.ShiftControlFreq = L4_MABX_P.ShifterControlFreq_Gain * |
| 22127 | L4_MABX_B.SFunction1_o1_p; |
| 22128 | |
| 22129 | /* S-Function (rti_commonblock): '<S730>/S-Function1' */ |
| 22130 | /* This comment workarounds a code generation problem */ |
| 22131 | { |
| 22132 | /* dSPACE I/O Board DS1401STDADCT4 #1 Unit:ADC Group:ADC */ |
| 22133 | adc_tp4_single_new_read(ADC_TP4_1_MODULE_ADDR, |
| 22134 | ADC_TP4_CH2, |
| 22135 | (dsfloat *)&L4_MABX_B.SFunction1_a); |
| 22136 | } |
| 22137 | |
| 22138 | /* Gain: '<S416>/ShifterControlDC2' */ |
| 22139 | L4_MABX_B.ShifterControlDC2 = L4_MABX_P.ShifterControlDC2_Gain * |
| 22140 | L4_MABX_B.SFunction1_a; |
| 22141 | |
| 22142 | /* S-Function (rti_commonblock): '<S731>/S-Function1' */ |
| 22143 | /* This comment workarounds a code generation problem */ |
| 22144 | { |
| 22145 | /* dSPACE I/O Board DS1401STDADCT4 #1 Unit:ADC Group:ADC */ |
| 22146 | adc_tp4_single_new_read(ADC_TP4_1_MODULE_ADDR, |
| 22147 | ADC_TP4_CH1, |
| 22148 | (dsfloat *)&L4_MABX_B.SFunction1_b); |
| 22149 | } |
| 22150 | |
| 22151 | /* Gain: '<S416>/ShifterControlDC1' */ |
| 22152 | L4_MABX_B.ShifterControlDC1 = L4_MABX_P.ShifterControlDC1_Gain * |
| 22153 | L4_MABX_B.SFunction1_b; |
| 22154 | |
| 22155 | /* S-Function (rti_commonblock): '<S8>/S-Function1' */ |
| 22156 | /* This comment workarounds a code generation problem */ |
| 22157 | |
| 22158 | /* S-Function (rti_commonblock): '<S9>/S-Function1' */ |
| 22159 | /* This comment workarounds a code generation problem */ |
| 22160 | |
| 22161 | /* UnitDelay: '<S10>/Unit_Delay' */ |
| 22162 | L4_MABX_B.Unit_Delay_jj = L4_MABX_DW.Unit_Delay_DSTATE_do; |
| 22163 | |
| 22164 | /* Outputs for Enabled SubSystem: '<S10>/EnabledSubsystem' incorporates: |
| 22165 | * EnablePort: '<S1091>/Enable' |
| 22166 | */ |
| 22167 | if (L4_MABX_B.Unit_Delay_jj) { |
| 22168 | /* Constant: '<S1091>/Constant' */ |
| 22169 | memcpy(&GLB_SWVERSION_CPV_[0], &L4_MABX_P.GLB_SWVERSION_CPV[0], 100U * |
| 22170 | sizeof(uint8_T)); |
| 22171 | } |
| 22172 | |
| 22173 | /* End of Outputs for SubSystem: '<S10>/EnabledSubsystem' */ |
| 22174 | /* user code (Output function Trailer for TID0) */ |
| 22175 | |
| 22176 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 22177 | /* EventChannel: 0 */ |
| 22178 | if (tid == 0) { |
| 22179 | DSXCP_service(0); |
| 22180 | } |
| 22181 | |
| 22182 | /* If subsystem generates rate grouping Output functions, |
| 22183 | * when tid is used in Output function for one rate, |
| 22184 | * all Output functions include tid as a local variable. |
| 22185 | * As result, some Output functions may have unused tid. |
| 22186 | */ |
| 22187 | UNUSED_PARAMETER(tid); |
| 22188 | } |
| 22189 | |
| 22190 | /* Model update function for TID0 */ |
| 22191 | void L4_MABX_update0(void) /* Sample time: [0.01s, 0.0s] */ |
| 22192 | { |
| 22193 | int32_T i; |
| 22194 | |
| 22195 | /* Update for UnitDelay: '<S757>/Unit Delay' */ |
| 22196 | L4_MABX_DW.UnitDelay_DSTATE = L4_MABX_B.Switch_p; |
| 22197 | |
| 22198 | /* Update for UnitDelay: '<S755>/Delay Input1' */ |
| 22199 | L4_MABX_DW.DelayInput1_DSTATE_g = L4_MABX_B.Compare; |
| 22200 | |
| 22201 | /* Update for UnitDelay: '<S756>/Unit Delay' */ |
| 22202 | L4_MABX_DW.UnitDelay_DSTATE_i = L4_MABX_B.Switch; |
| 22203 | |
| 22204 | /* Update for UnitDelay: '<S743>/Unit Delay' */ |
| 22205 | L4_MABX_DW.UnitDelay_DSTATE_ms = L4_MABX_B.AND_f; |
| 22206 | |
| 22207 | /* Update for UnitDelay: '<S754>/Delay Input1' */ |
| 22208 | L4_MABX_DW.DelayInput1_DSTATE_m = L4_MABX_B.Compare_p; |
| 22209 | |
| 22210 | /* Update for UnitDelay: '<S756>/Unit Delay1' */ |
| 22211 | L4_MABX_DW.UnitDelay1_DSTATE_bf = L4_MABX_B.AND; |
| 22212 | |
| 22213 | /* Update for UnitDelay: '<S757>/Unit Delay1' */ |
| 22214 | L4_MABX_DW.UnitDelay1_DSTATE_e = L4_MABX_B.AND_f; |
| 22215 | |
| 22216 | /* Update for UnitDelay: '<S796>/FixPt Unit Delay2' incorporates: |
| 22217 | * Constant: '<S796>/FixPt Constant' |
| 22218 | */ |
| 22219 | L4_MABX_DW.FixPtUnitDelay2_DSTATE = L4_MABX_P.FixPtConstant_Value_oa; |
| 22220 | |
| 22221 | /* Update for UnitDelay: '<S796>/FixPt Unit Delay1' */ |
| 22222 | L4_MABX_DW.FixPtUnitDelay1_DSTATE = L4_MABX_B.If_Then_Else_m.Switch; |
| 22223 | |
| 22224 | /* Update for UnitDelay: '<S788>/FixPt Unit Delay2' incorporates: |
| 22225 | * Constant: '<S788>/FixPt Constant' |
| 22226 | */ |
| 22227 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_k = L4_MABX_P.FixPtConstant_Value_ok; |
| 22228 | |
| 22229 | /* Update for UnitDelay: '<S788>/FixPt Unit Delay1' */ |
| 22230 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_p = L4_MABX_B.If_Then_Else_g.Switch; |
| 22231 | |
| 22232 | /* Update for UnitDelay: '<S812>/FixPt Unit Delay2' incorporates: |
| 22233 | * Constant: '<S812>/FixPt Constant' |
| 22234 | */ |
| 22235 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_e = L4_MABX_P.FixPtConstant_Value_jkn; |
| 22236 | |
| 22237 | /* Update for UnitDelay: '<S812>/FixPt Unit Delay1' */ |
| 22238 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_p4 = L4_MABX_B.If_Then_Else_b.Switch; |
| 22239 | |
| 22240 | /* Update for UnitDelay: '<S804>/FixPt Unit Delay2' incorporates: |
| 22241 | * Constant: '<S804>/FixPt Constant' |
| 22242 | */ |
| 22243 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_g = L4_MABX_P.FixPtConstant_Value_fv; |
| 22244 | |
| 22245 | /* Update for UnitDelay: '<S804>/FixPt Unit Delay1' */ |
| 22246 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_pb = L4_MABX_B.If_Then_Else_a.Switch; |
| 22247 | |
| 22248 | /* Update for UnitDelay: '<S766>/Unit_Delay' incorporates: |
| 22249 | * Constant: '<S766>/Constant' |
| 22250 | */ |
| 22251 | L4_MABX_DW.Unit_Delay_DSTATE_mb = L4_MABX_P.Constant_Value_dy; |
| 22252 | |
| 22253 | /* Update for UnitDelay: '<S833>/Unit_Delay1' incorporates: |
| 22254 | * Constant: '<S833>/Constant' |
| 22255 | */ |
| 22256 | L4_MABX_DW.Unit_Delay1_DSTATE = L4_MABX_P.Constant_Value_l2; |
| 22257 | |
| 22258 | /* Update for UnitDelay: '<S833>/Unit_Delay2' */ |
| 22259 | L4_MABX_DW.Unit_Delay2_DSTATE = L4_MABX_B.If_Then_Else_e.Switch; |
| 22260 | |
| 22261 | /* Update for UnitDelay: '<S766>/Unit_Delay1' incorporates: |
| 22262 | * Constant: '<S766>/Constant1' |
| 22263 | */ |
| 22264 | L4_MABX_DW.Unit_Delay1_DSTATE_a = L4_MABX_P.Constant1_Value_f4; |
| 22265 | |
| 22266 | /* Update for UnitDelay: '<S834>/Unit_Delay1' incorporates: |
| 22267 | * Constant: '<S834>/Constant' |
| 22268 | */ |
| 22269 | L4_MABX_DW.Unit_Delay1_DSTATE_l = L4_MABX_P.Constant_Value_n5; |
| 22270 | |
| 22271 | /* Update for UnitDelay: '<S834>/Unit_Delay2' */ |
| 22272 | L4_MABX_DW.Unit_Delay2_DSTATE_m = L4_MABX_B.If_Then_Else_ex.Switch; |
| 22273 | |
| 22274 | /* Update for UnitDelay: '<S832>/FixPt Unit Delay2' incorporates: |
| 22275 | * Constant: '<S832>/FixPt Constant' |
| 22276 | */ |
| 22277 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_o = L4_MABX_P.FixPtConstant_Value_n4; |
| 22278 | |
| 22279 | /* Update for UnitDelay: '<S832>/FixPt Unit Delay1' */ |
| 22280 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g = L4_MABX_B.If_Then_Else3_l.Switch; |
| 22281 | |
| 22282 | /* Update for UnitDelay: '<S831>/FixPt Unit Delay2' incorporates: |
| 22283 | * Constant: '<S831>/FixPt Constant' |
| 22284 | */ |
| 22285 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_h = L4_MABX_P.FixPtConstant_Value_bo; |
| 22286 | |
| 22287 | /* Update for UnitDelay: '<S831>/FixPt Unit Delay1' */ |
| 22288 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_p2 = L4_MABX_B.If_Then_Else1_kz.Switch; |
| 22289 | |
| 22290 | /* Update for UnitDelay: '<S820>/FixPt Unit Delay2' incorporates: |
| 22291 | * Constant: '<S820>/FixPt Constant' |
| 22292 | */ |
| 22293 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_eo = L4_MABX_P.FixPtConstant_Value_je; |
| 22294 | |
| 22295 | /* Update for UnitDelay: '<S820>/FixPt Unit Delay1' */ |
| 22296 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_h = L4_MABX_B.If_Then_Else_k2.Switch; |
| 22297 | |
| 22298 | /* Update for Enabled SubSystem: '<S744>/Slew_at_event' incorporates: |
| 22299 | * EnablePort: '<S767>/Enable' |
| 22300 | */ |
| 22301 | if (L4_MABX_DW.Slew_at_event_MODE) { |
| 22302 | /* Update for UnitDelay: '<S838>/Unit_Delay' */ |
| 22303 | L4_MABX_DW.Unit_Delay_DSTATE_k = L4_MABX_B.LogicalOperator6_e; |
| 22304 | |
| 22305 | /* Update for UnitDelay: '<S839>/Unit_Delay' incorporates: |
| 22306 | * Constant: '<S839>/Constant' |
| 22307 | */ |
| 22308 | L4_MABX_DW.Unit_Delay_DSTATE_hv = L4_MABX_P.Constant_Value_mz; |
| 22309 | |
| 22310 | /* Update for UnitDelay: '<S842>/FixPt Unit Delay2' incorporates: |
| 22311 | * Constant: '<S842>/FixPt Constant' |
| 22312 | */ |
| 22313 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_b = L4_MABX_P.FixPtConstant_Value_mu; |
| 22314 | |
| 22315 | /* Update for UnitDelay: '<S842>/FixPt Unit Delay1' */ |
| 22316 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_i = L4_MABX_B.If_Then_Else_is.Switch; |
| 22317 | |
| 22318 | /* Update for UnitDelay: '<S837>/Unit_Delay' */ |
| 22319 | L4_MABX_DW.Unit_Delay_DSTATE_i4 = L4_MABX_B.LogicalOperator_a; |
| 22320 | } |
| 22321 | |
| 22322 | /* End of Update for SubSystem: '<S744>/Slew_at_event' */ |
| 22323 | |
| 22324 | /* Update for Enabled SubSystem: '<S436>/CAN_RX_EC1_00' incorporates: |
| 22325 | * EnablePort: '<S520>/Enable' |
| 22326 | */ |
| 22327 | if (L4_MABX_B.LogicalOperator_n) { |
| 22328 | /* Update for UnitDelay: '<S520>/Unit Delay' */ |
| 22329 | for (i = 0; i < 39; i++) { |
| 22330 | L4_MABX_DW.UnitDelay_DSTATE_l[i] = L4_MABX_B.Data_d[i]; |
| 22331 | } |
| 22332 | |
| 22333 | /* End of Update for UnitDelay: '<S520>/Unit Delay' */ |
| 22334 | |
| 22335 | /* Update for Enabled SubSystem: '<S520>/Decode' incorporates: |
| 22336 | * EnablePort: '<S523>/Enable' |
| 22337 | */ |
| 22338 | if (L4_MABX_B.RX_status_kj) { |
| 22339 | /* Update for UnitDelay: '<S523>/Unit_Delay' */ |
| 22340 | L4_MABX_DW.Unit_Delay_DSTATE_lq = L4_MABX_B.timeStamp_o; |
| 22341 | } |
| 22342 | |
| 22343 | /* End of Update for SubSystem: '<S520>/Decode' */ |
| 22344 | } |
| 22345 | |
| 22346 | /* End of Update for SubSystem: '<S436>/CAN_RX_EC1_00' */ |
| 22347 | |
| 22348 | /* Update for UnitDelay: '<S649>/Unit_Delay3' */ |
| 22349 | L4_MABX_DW.Unit_Delay3_DSTATE = L4_MABX_B.LogicalOperator2_e; |
| 22350 | |
| 22351 | /* Update for Enabled SubSystem: '<S459>/CAN_RX_VI_00' incorporates: |
| 22352 | * EnablePort: '<S648>/Enable' |
| 22353 | */ |
| 22354 | if (L4_MABX_B.LogicalOperator_ne) { |
| 22355 | /* Update for UnitDelay: '<S648>/Unit Delay' */ |
| 22356 | for (i = 0; i < 17; i++) { |
| 22357 | L4_MABX_DW.UnitDelay_DSTATE_bh[i] = L4_MABX_B.Data[i]; |
| 22358 | } |
| 22359 | |
| 22360 | /* End of Update for UnitDelay: '<S648>/Unit Delay' */ |
| 22361 | |
| 22362 | /* Update for Enabled SubSystem: '<S648>/Decode' incorporates: |
| 22363 | * EnablePort: '<S651>/Enable' |
| 22364 | */ |
| 22365 | if (L4_MABX_B.RX_status_dx) { |
| 22366 | /* Update for UnitDelay: '<S651>/Unit_Delay' */ |
| 22367 | L4_MABX_DW.Unit_Delay_DSTATE_f = L4_MABX_B.timeStamp; |
| 22368 | } |
| 22369 | |
| 22370 | /* End of Update for SubSystem: '<S648>/Decode' */ |
| 22371 | } |
| 22372 | |
| 22373 | /* End of Update for SubSystem: '<S459>/CAN_RX_VI_00' */ |
| 22374 | |
| 22375 | /* Update for UnitDelay: '<S649>/Unit_Delay' incorporates: |
| 22376 | * Constant: '<S649>/Constant' |
| 22377 | */ |
| 22378 | L4_MABX_DW.Unit_Delay_DSTATE_i5 = L4_MABX_P.Constant_Value_a2f; |
| 22379 | |
| 22380 | /* Update for UnitDelay: '<S655>/Unit_Delay' */ |
| 22381 | L4_MABX_DW.Unit_Delay_DSTATE_eo = L4_MABX_B.LogicalOperator1_e; |
| 22382 | |
| 22383 | /* Update for UnitDelay: '<S3>/Unit_Delay' */ |
| 22384 | L4_MABX_DW.Unit_Delay_80_DSTATE = EStop; |
| 22385 | L4_MABX_DW.Unit_Delay_81_DSTATE = EnableSw; |
| 22386 | L4_MABX_DW.Unit_Delay_48_DSTATE = EngageReq; |
| 22387 | L4_MABX_DW.Unit_Delay_83_DSTATE = LogEventPB; |
| 22388 | L4_MABX_DW.Unit_Delay_45_DSTATE = AutonomousEnabled; |
| 22389 | L4_MABX_DW.Unit_Delay_47_DSTATE = MABX_Mode; |
| 22390 | L4_MABX_DW.Unit_Delay_84_DSTATE = BrakeSW; |
| 22391 | |
| 22392 | /* Update for UnitDelay: '<S405>/Delay Input1' */ |
| 22393 | L4_MABX_DW.DelayInput1_DSTATE_n = L4_MABX_B.Compare_c5; |
| 22394 | |
| 22395 | /* Update for UnitDelay: '<S403>/Unit Delay' */ |
| 22396 | L4_MABX_DW.UnitDelay_DSTATE_k = L4_MABX_B.Count; |
| 22397 | |
| 22398 | /* Update for Atomic SubSystem: '<S65>/Task_10ms' */ |
| 22399 | /* Update for UnitDelay: '<S76>/Unit_Delay' */ |
| 22400 | L4_MABX_DW.Unit_Delay_DSTATE_fv = AutonomousEnabled; |
| 22401 | |
| 22402 | /* Update for UnitDelay: '<S97>/Unit Delay1' */ |
| 22403 | L4_MABX_DW.UnitDelay1_DSTATE_m = L4_MABX_B.Switch_a; |
| 22404 | |
| 22405 | /* Update for UnitDelay: '<S98>/Delay Input1' */ |
| 22406 | L4_MABX_DW.DelayInput1_DSTATE_d = L4_MABX_B.Compare_jp; |
| 22407 | |
| 22408 | /* Update for UnitDelay: '<S97>/Unit Delay' */ |
| 22409 | L4_MABX_DW.UnitDelay_DSTATE_b1 = L4_MABX_B.AND_fu; |
| 22410 | |
| 22411 | /* Update for Enabled SubSystem: '<S79>/Throttle_controller_gov' incorporates: |
| 22412 | * EnablePort: '<S212>/Enable' |
| 22413 | */ |
| 22414 | if (L4_MABX_DW.Throttle_controller_gov_MODE) { |
| 22415 | /* Update for UnitDelay: '<S220>/Unit_Delay1' incorporates: |
| 22416 | * Constant: '<S220>/Constant3' |
| 22417 | */ |
| 22418 | L4_MABX_DW.Unit_Delay1_DSTATE_p1 = L4_MABX_P.Constant3_Value_lp; |
| 22419 | |
| 22420 | /* Update for UnitDelay: '<S220>/Unit_Delay' */ |
| 22421 | L4_MABX_DW.Unit_Delay_DSTATE_lqi = L4_MABX_B.RelationalOperator_fl; |
| 22422 | |
| 22423 | /* Update for UnitDelay: '<S247>/Unit_Delay' incorporates: |
| 22424 | * Constant: '<S247>/Constant' |
| 22425 | */ |
| 22426 | L4_MABX_DW.Unit_Delay_DSTATE_be = L4_MABX_P.Constant_Value_ck; |
| 22427 | |
| 22428 | /* Update for UnitDelay: '<S267>/Unit_Delay1' incorporates: |
| 22429 | * Constant: '<S267>/Constant' |
| 22430 | */ |
| 22431 | L4_MABX_DW.Unit_Delay1_DSTATE_h = L4_MABX_P.Constant_Value_ot; |
| 22432 | |
| 22433 | /* Update for UnitDelay: '<S268>/Unit_Delay' incorporates: |
| 22434 | * Constant: '<S268>/Constant' |
| 22435 | */ |
| 22436 | L4_MABX_DW.Unit_Delay_DSTATE_fi = L4_MABX_P.Constant_Value_h0; |
| 22437 | |
| 22438 | /* Update for UnitDelay: '<S272>/FixPt Unit Delay2' incorporates: |
| 22439 | * Constant: '<S272>/FixPt Constant' |
| 22440 | */ |
| 22441 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_gq = L4_MABX_P.FixPtConstant_Value_jk; |
| 22442 | |
| 22443 | /* Update for UnitDelay: '<S272>/FixPt Unit Delay1' */ |
| 22444 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_a = L4_MABX_B.If_Then_Else_cp.Switch; |
| 22445 | |
| 22446 | /* Update for UnitDelay: '<S267>/Unit_Delay2' */ |
| 22447 | L4_MABX_DW.Unit_Delay2_DSTATE_mh = L4_MABX_B.If_Then_Else_k2t.Switch; |
| 22448 | |
| 22449 | /* Update for Enabled SubSystem: '<S244>/Calculate_D_term' */ |
| 22450 | L4__Calculate_D_term_Update(&L4_MABX_B.Calculate_D_term_h, |
| 22451 | &L4_MABX_DW.Calculate_D_term_h, &L4_MABX_P.Calculate_D_term_h); |
| 22452 | |
| 22453 | /* End of Update for SubSystem: '<S244>/Calculate_D_term' */ |
| 22454 | |
| 22455 | /* Update for UnitDelay: '<S222>/Unit_Delay' */ |
| 22456 | L4_MABX_DW.Unit_Delay_DSTATE_fz = L4_MABX_B.Add_ds; |
| 22457 | |
| 22458 | /* Update for Enabled SubSystem: '<S244>/Calculate_I_term' */ |
| 22459 | L4__Calculate_I_term_Update(&L4_MABX_B.Calculate_I_term_n, |
| 22460 | &L4_MABX_DW.Calculate_I_term_n, &L4_MABX_P.Calculate_I_term_n); |
| 22461 | |
| 22462 | /* End of Update for SubSystem: '<S244>/Calculate_I_term' */ |
| 22463 | } |
| 22464 | |
| 22465 | /* End of Update for SubSystem: '<S79>/Throttle_controller_gov' */ |
| 22466 | |
| 22467 | /* Update for Enabled SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' incorporates: |
| 22468 | * EnablePort: '<S184>/Enable' |
| 22469 | */ |
| 22470 | if (L4_MABX_DW.Determine_shift_interlock_brake) { |
| 22471 | /* Update for UnitDelay: '<S184>/Unit_Delay' */ |
| 22472 | L4_MABX_DW.Unit_Delay_DSTATE_o = L4_MABX_B.If_Then_Else_il.Switch; |
| 22473 | |
| 22474 | /* Update for UnitDelay: '<S194>/Unit_Delay' incorporates: |
| 22475 | * Constant: '<S194>/Constant' |
| 22476 | */ |
| 22477 | L4_MABX_DW.Unit_Delay_DSTATE_a = L4_MABX_P.Constant_Value_ii; |
| 22478 | |
| 22479 | /* Update for UnitDelay: '<S198>/FixPt Unit Delay2' incorporates: |
| 22480 | * Constant: '<S198>/FixPt Constant' |
| 22481 | */ |
| 22482 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_l = L4_MABX_P.FixPtConstant_Value_kr; |
| 22483 | |
| 22484 | /* Update for UnitDelay: '<S198>/FixPt Unit Delay1' */ |
| 22485 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_d = L4_MABX_B.If_Then_Else_ep.Switch; |
| 22486 | |
| 22487 | /* Update for UnitDelay: '<S195>/Unit_Delay' */ |
| 22488 | L4_MABX_DW.Unit_Delay_DSTATE_om = L4_MABX_B.DigitalClock_e; |
| 22489 | } |
| 22490 | |
| 22491 | /* End of Update for SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */ |
| 22492 | |
| 22493 | /* Update for Enabled SubSystem: '<S105>/Determine_brake_hold_pressure_target' incorporates: |
| 22494 | * EnablePort: '<S183>/Enable' |
| 22495 | */ |
| 22496 | if (L4_MABX_DW.Determine_brake_hold_pressure_t) { |
| 22497 | /* Update for UnitDelay: '<S183>/Unit_Delay' */ |
| 22498 | L4_MABX_DW.Unit_Delay_DSTATE_c = L4_MABX_B.If_Then_Else_gj.Switch; |
| 22499 | |
| 22500 | /* Update for UnitDelay: '<S187>/Unit_Delay' incorporates: |
| 22501 | * Constant: '<S187>/Constant' |
| 22502 | */ |
| 22503 | L4_MABX_DW.Unit_Delay_DSTATE_or = L4_MABX_P.Constant_Value_m3d; |
| 22504 | |
| 22505 | /* Update for UnitDelay: '<S191>/FixPt Unit Delay2' incorporates: |
| 22506 | * Constant: '<S191>/FixPt Constant' |
| 22507 | */ |
| 22508 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_je = L4_MABX_P.FixPtConstant_Value_aw; |
| 22509 | |
| 22510 | /* Update for UnitDelay: '<S191>/FixPt Unit Delay1' */ |
| 22511 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_b = L4_MABX_B.If_Then_Else_nz.Switch; |
| 22512 | |
| 22513 | /* Update for UnitDelay: '<S188>/Unit_Delay' */ |
| 22514 | L4_MABX_DW.Unit_Delay_DSTATE_oj = L4_MABX_B.DigitalClock_c; |
| 22515 | } |
| 22516 | |
| 22517 | /* End of Update for SubSystem: '<S105>/Determine_brake_hold_pressure_target' */ |
| 22518 | |
| 22519 | /* Update for Enabled SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' incorporates: |
| 22520 | * EnablePort: '<S102>/Enable' |
| 22521 | */ |
| 22522 | if (L4_MABX_DW.Bendix_2C2_brake_application_pr) { |
| 22523 | /* Update for UnitDelay: '<S111>/Unit_Delay' */ |
| 22524 | L4_MABX_DW.Unit_Delay_DSTATE_d = L4_MABX_B.DigitalClock_j; |
| 22525 | |
| 22526 | /* Update for UnitDelay: '<S115>/Unit_Delay' incorporates: |
| 22527 | * Constant: '<S115>/Constant' |
| 22528 | */ |
| 22529 | L4_MABX_DW.Unit_Delay_DSTATE_omj = L4_MABX_P.Constant_Value_lo; |
| 22530 | |
| 22531 | /* Update for UnitDelay: '<S135>/Unit_Delay1' incorporates: |
| 22532 | * Constant: '<S135>/Constant' |
| 22533 | */ |
| 22534 | L4_MABX_DW.Unit_Delay1_DSTATE_b = L4_MABX_P.Constant_Value_olo; |
| 22535 | |
| 22536 | /* Update for UnitDelay: '<S136>/Unit_Delay' incorporates: |
| 22537 | * Constant: '<S136>/Constant' |
| 22538 | */ |
| 22539 | L4_MABX_DW.Unit_Delay_DSTATE_h4 = L4_MABX_P.Constant_Value_hi; |
| 22540 | |
| 22541 | /* Update for UnitDelay: '<S140>/FixPt Unit Delay2' incorporates: |
| 22542 | * Constant: '<S140>/FixPt Constant' |
| 22543 | */ |
| 22544 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_gm = L4_MABX_P.FixPtConstant_Value_fl; |
| 22545 | |
| 22546 | /* Update for UnitDelay: '<S140>/FixPt Unit Delay1' */ |
| 22547 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g1 = L4_MABX_B.If_Then_Else_bg.Switch; |
| 22548 | |
| 22549 | /* Update for UnitDelay: '<S135>/Unit_Delay2' */ |
| 22550 | L4_MABX_DW.Unit_Delay2_DSTATE_dy = L4_MABX_B.If_Then_Else_ly.Switch; |
| 22551 | |
| 22552 | /* Update for Enabled SubSystem: '<S112>/Calculate_D_term' */ |
| 22553 | L4__Calculate_D_term_Update(&L4_MABX_B.Calculate_D_term, |
| 22554 | &L4_MABX_DW.Calculate_D_term, &L4_MABX_P.Calculate_D_term); |
| 22555 | |
| 22556 | /* End of Update for SubSystem: '<S112>/Calculate_D_term' */ |
| 22557 | |
| 22558 | /* Update for UnitDelay: '<S110>/Unit_Delay' */ |
| 22559 | L4_MABX_DW.Unit_Delay_DSTATE_i = L4_MABX_B.Add_e; |
| 22560 | |
| 22561 | /* Update for Enabled SubSystem: '<S112>/Calculate_I_term' */ |
| 22562 | L4__Calculate_I_term_Update(&L4_MABX_B.Calculate_I_term, |
| 22563 | &L4_MABX_DW.Calculate_I_term, &L4_MABX_P.Calculate_I_term); |
| 22564 | |
| 22565 | /* End of Update for SubSystem: '<S112>/Calculate_I_term' */ |
| 22566 | } |
| 22567 | |
| 22568 | /* End of Update for SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */ |
| 22569 | |
| 22570 | /* Update for UnitDelay: '<S389>/Unit_Delay' */ |
| 22571 | L4_MABX_DW.Unit_Delay_DSTATE_cx = L4_MABX_B.LogicalOperator2_f; |
| 22572 | |
| 22573 | /* Update for UnitDelay: '<S390>/Unit_Delay' incorporates: |
| 22574 | * Constant: '<S390>/Constant' |
| 22575 | */ |
| 22576 | L4_MABX_DW.Unit_Delay_DSTATE_d0 = L4_MABX_P.Constant_Value_c1; |
| 22577 | |
| 22578 | /* Update for UnitDelay: '<S347>/Unit_Delay' */ |
| 22579 | L4_MABX_DW.Unit_Delay_DSTATE_e = L4_MABX_B.If_Then_Else_m4.Switch; |
| 22580 | |
| 22581 | /* Update for UnitDelay: '<S394>/FixPt Unit Delay2' incorporates: |
| 22582 | * Constant: '<S394>/FixPt Constant' |
| 22583 | */ |
| 22584 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_a = L4_MABX_P.FixPtConstant_Value_jx; |
| 22585 | |
| 22586 | /* Update for UnitDelay: '<S394>/FixPt Unit Delay1' */ |
| 22587 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_hj = L4_MABX_B.If_Then_Else_m4.Switch; |
| 22588 | |
| 22589 | /* Update for UnitDelay: '<S391>/Unit_Delay' */ |
| 22590 | L4_MABX_DW.Unit_Delay_DSTATE_m = L4_MABX_B.DigitalClock; |
| 22591 | |
| 22592 | /* Update for UnitDelay: '<S378>/Unit_Delay' */ |
| 22593 | L4_MABX_DW.Unit_Delay_DSTATE_iy = L4_MABX_B.LogicalOperator1_g; |
| 22594 | |
| 22595 | /* Update for UnitDelay: '<S379>/Unit_Delay' incorporates: |
| 22596 | * Constant: '<S379>/Constant' |
| 22597 | */ |
| 22598 | L4_MABX_DW.Unit_Delay_DSTATE_mv = L4_MABX_P.Constant_Value_am; |
| 22599 | |
| 22600 | /* Update for UnitDelay: '<S345>/Unit_Delay' */ |
| 22601 | L4_MABX_DW.Unit_Delay_DSTATE_g = L4_MABX_B.If_Then_Else_bf.Switch; |
| 22602 | |
| 22603 | /* Update for UnitDelay: '<S383>/FixPt Unit Delay2' incorporates: |
| 22604 | * Constant: '<S383>/FixPt Constant' |
| 22605 | */ |
| 22606 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_i = L4_MABX_P.FixPtConstant_Value_d; |
| 22607 | |
| 22608 | /* Update for UnitDelay: '<S383>/FixPt Unit Delay1' */ |
| 22609 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_hq = L4_MABX_B.If_Then_Else_bf.Switch; |
| 22610 | |
| 22611 | /* Update for UnitDelay: '<S380>/Unit_Delay' */ |
| 22612 | L4_MABX_DW.Unit_Delay_DSTATE_b = L4_MABX_B.DigitalClock_b; |
| 22613 | |
| 22614 | /* Update for UnitDelay: '<S342>/Delay Input1' */ |
| 22615 | L4_MABX_DW.DelayInput1_DSTATE[0] = L4_MABX_B.Distance_to_achieve_speed_targe; |
| 22616 | L4_MABX_DW.DelayInput1_DSTATE[1] = L4_MABX_B.Vehicle_speed_target_o; |
| 22617 | |
| 22618 | /* Update for UnitDelay: '<S360>/Unit_Delay' */ |
| 22619 | L4_MABX_DW.Unit_Delay_DSTATE_bw = L4_MABX_B.If_Then_Else_og.Switch; |
| 22620 | |
| 22621 | /* Update for UnitDelay: '<S362>/Unit_Delay' */ |
| 22622 | L4_MABX_DW.Unit_Delay_DSTATE_ko = L4_MABX_B.LogicalOperator1_ph; |
| 22623 | |
| 22624 | /* Update for UnitDelay: '<S371>/FixPt Unit Delay2' incorporates: |
| 22625 | * Constant: '<S371>/FixPt Constant' |
| 22626 | */ |
| 22627 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_f = L4_MABX_P.FixPtConstant_Value_gy; |
| 22628 | |
| 22629 | /* Update for UnitDelay: '<S371>/FixPt Unit Delay1' */ |
| 22630 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_l = L4_MABX_B.Xnew; |
| 22631 | |
| 22632 | /* Update for UnitDelay: '<S369>/Unit_Delay' */ |
| 22633 | L4_MABX_DW.Unit_Delay_DSTATE_p = L4_MABX_B.DigitalClock_f; |
| 22634 | |
| 22635 | /* Update for UnitDelay: '<S349>/Delay Input1' */ |
| 22636 | L4_MABX_DW.DelayInput1_DSTATE_f[0] = L4_MABX_B.Distance_to_achieve_speed_targe; |
| 22637 | L4_MABX_DW.DelayInput1_DSTATE_f[1] = L4_MABX_B.Vehicle_speed_target_o; |
| 22638 | |
| 22639 | /* Update for UnitDelay: '<S351>/Unit_Delay' incorporates: |
| 22640 | * Constant: '<S351>/Constant' |
| 22641 | */ |
| 22642 | L4_MABX_DW.Unit_Delay_DSTATE_la = L4_MABX_P.Constant_Value_pu; |
| 22643 | |
| 22644 | /* Update for UnitDelay: '<S355>/FixPt Unit Delay2' incorporates: |
| 22645 | * Constant: '<S355>/FixPt Constant' |
| 22646 | */ |
| 22647 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_c = L4_MABX_P.FixPtConstant_Value_az; |
| 22648 | |
| 22649 | /* Update for UnitDelay: '<S355>/FixPt Unit Delay1' */ |
| 22650 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_e = L4_MABX_B.If_Then_Else_pz.Switch; |
| 22651 | |
| 22652 | /* Update for UnitDelay: '<S350>/Unit_Delay' */ |
| 22653 | L4_MABX_DW.Unit_Delay_1_DSTATE_j = |
| 22654 | L4_MABX_B.If_Then_Else_mm.Vehicle_speed_target; |
| 22655 | L4_MABX_DW.Unit_Delay_2_DSTATE_e = L4_MABX_B.If_Then_Else_mm.Vehicle_speed; |
| 22656 | L4_MABX_DW.Unit_Delay_3_DSTATE_j = L4_MABX_B.If_Then_Else_mm.Distance_m; |
| 22657 | |
| 22658 | /* Update for UnitDelay: '<S348>/Unit_Delay' */ |
| 22659 | L4_MABX_DW.Unit_Delay_DSTATE_ff = L4_MABX_B.DigitalClock_p; |
| 22660 | |
| 22661 | /* Update for Enabled SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' incorporates: |
| 22662 | * EnablePort: '<S103>/Enable' |
| 22663 | */ |
| 22664 | if (L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba) { |
| 22665 | /* Update for UnitDelay: '<S146>/Unit_Delay' */ |
| 22666 | L4_MABX_DW.Unit_Delay_DSTATE_eu = L4_MABX_B.DigitalClock_n; |
| 22667 | |
| 22668 | /* Update for UnitDelay: '<S153>/Unit_Delay' incorporates: |
| 22669 | * Constant: '<S153>/Constant' |
| 22670 | */ |
| 22671 | L4_MABX_DW.Unit_Delay_DSTATE_nw = L4_MABX_P.Constant_Value_j5; |
| 22672 | |
| 22673 | /* Update for UnitDelay: '<S173>/Unit_Delay1' incorporates: |
| 22674 | * Constant: '<S173>/Constant' |
| 22675 | */ |
| 22676 | L4_MABX_DW.Unit_Delay1_DSTATE_f = L4_MABX_P.Constant_Value_bd; |
| 22677 | |
| 22678 | /* Update for UnitDelay: '<S174>/Unit_Delay' incorporates: |
| 22679 | * Constant: '<S174>/Constant' |
| 22680 | */ |
| 22681 | L4_MABX_DW.Unit_Delay_DSTATE_g4 = L4_MABX_P.Constant_Value_m2; |
| 22682 | |
| 22683 | /* Update for UnitDelay: '<S178>/FixPt Unit Delay2' incorporates: |
| 22684 | * Constant: '<S178>/FixPt Constant' |
| 22685 | */ |
| 22686 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_o4 = L4_MABX_P.FixPtConstant_Value_j; |
| 22687 | |
| 22688 | /* Update for UnitDelay: '<S178>/FixPt Unit Delay1' */ |
| 22689 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g2 = L4_MABX_B.If_Then_Else_iy.Switch; |
| 22690 | |
| 22691 | /* Update for UnitDelay: '<S173>/Unit_Delay2' */ |
| 22692 | L4_MABX_DW.Unit_Delay2_DSTATE_c = L4_MABX_B.If_Then_Else_bc.Switch; |
| 22693 | |
| 22694 | /* Update for Enabled SubSystem: '<S150>/Calculate_D_term' */ |
| 22695 | L4__Calculate_D_term_Update(&L4_MABX_B.Calculate_D_term_p, |
| 22696 | &L4_MABX_DW.Calculate_D_term_p, &L4_MABX_P.Calculate_D_term_p); |
| 22697 | |
| 22698 | /* End of Update for SubSystem: '<S150>/Calculate_D_term' */ |
| 22699 | |
| 22700 | /* Update for UnitDelay: '<S145>/Unit_Delay' */ |
| 22701 | L4_MABX_DW.Unit_Delay_DSTATE_h = L4_MABX_B.Add_mh; |
| 22702 | |
| 22703 | /* Update for Enabled SubSystem: '<S150>/Calculate_I_term' */ |
| 22704 | L4__Calculate_I_term_Update(&L4_MABX_B.Calculate_I_term_e, |
| 22705 | &L4_MABX_DW.Calculate_I_term_e, &L4_MABX_P.Calculate_I_term_e); |
| 22706 | |
| 22707 | /* End of Update for SubSystem: '<S150>/Calculate_I_term' */ |
| 22708 | } |
| 22709 | |
| 22710 | /* End of Update for SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */ |
| 22711 | |
| 22712 | /* Update for UnitDelay: '<S107>/Unit_Delay' incorporates: |
| 22713 | * Constant: '<S107>/Constant7' |
| 22714 | */ |
| 22715 | L4_MABX_DW.Unit_Delay_DSTATE_eu4 = L4_MABX_P.Constant7_Value_j; |
| 22716 | |
| 22717 | /* Update for UnitDelay: '<S203>/Unit_Delay1' incorporates: |
| 22718 | * Constant: '<S203>/Constant' |
| 22719 | */ |
| 22720 | L4_MABX_DW.Unit_Delay1_DSTATE_di = L4_MABX_P.Constant_Value_jf; |
| 22721 | |
| 22722 | /* Update for UnitDelay: '<S203>/Unit_Delay2' */ |
| 22723 | L4_MABX_DW.Unit_Delay2_DSTATE_e = L4_MABX_B.If_Then_Else_ga.Switch; |
| 22724 | |
| 22725 | /* Update for UnitDelay: '<S202>/UD' */ |
| 22726 | L4_MABX_DW.UD_DSTATE = L4_MABX_B.TSamp; |
| 22727 | |
| 22728 | /* Update for UnitDelay: '<S327>/Unit_Delay1' incorporates: |
| 22729 | * Constant: '<S327>/Constant' |
| 22730 | */ |
| 22731 | L4_MABX_DW.Unit_Delay1_DSTATE_db = L4_MABX_P.Constant_Value_hx; |
| 22732 | |
| 22733 | /* Update for UnitDelay: '<S327>/Unit_Delay2' */ |
| 22734 | L4_MABX_DW.Unit_Delay2_DSTATE_d = L4_MABX_B.If_Then_Else_b3.Switch; |
| 22735 | |
| 22736 | /* Update for UnitDelay: '<S326>/Delay Input1' */ |
| 22737 | L4_MABX_DW.DelayInput1_DSTATE_f0 = L4_MABX_B.JumpNearEdge; |
| 22738 | |
| 22739 | /* Update for UnitDelay: '<S328>/Unit_Delay1' incorporates: |
| 22740 | * Constant: '<S328>/Constant' |
| 22741 | */ |
| 22742 | L4_MABX_DW.Unit_Delay1_DSTATE_as = L4_MABX_P.Constant_Value_bh; |
| 22743 | |
| 22744 | /* Update for UnitDelay: '<S328>/Unit_Delay2' */ |
| 22745 | L4_MABX_DW.Unit_Delay2_DSTATE_i = L4_MABX_B.If_Then_Else_mk.Switch; |
| 22746 | |
| 22747 | /* Update for UnitDelay: '<S329>/Unit_Delay1' incorporates: |
| 22748 | * Constant: '<S329>/Constant' |
| 22749 | */ |
| 22750 | L4_MABX_DW.Unit_Delay1_DSTATE_p = L4_MABX_P.Constant_Value_hxo; |
| 22751 | |
| 22752 | /* Update for UnitDelay: '<S329>/Unit_Delay2' */ |
| 22753 | L4_MABX_DW.Unit_Delay2_DSTATE_p = L4_MABX_B.If_Then_Else_lh.Switch; |
| 22754 | |
| 22755 | /* Update for Enabled SubSystem: '<S283>/Slew_at_event' incorporates: |
| 22756 | * EnablePort: '<S334>/Enable' |
| 22757 | */ |
| 22758 | if (L4_MABX_DW.Slew_at_event_MODE_d) { |
| 22759 | /* Update for UnitDelay: '<S336>/Unit_Delay' */ |
| 22760 | L4_MABX_DW.Unit_Delay_DSTATE_bd = L4_MABX_B.DataTypeConversion_l1; |
| 22761 | |
| 22762 | /* Update for UnitDelay: '<S337>/Unit_Delay' incorporates: |
| 22763 | * Constant: '<S337>/Constant' |
| 22764 | */ |
| 22765 | L4_MABX_DW.Unit_Delay_DSTATE_jt = L4_MABX_P.Constant_Value_hg; |
| 22766 | |
| 22767 | /* Update for UnitDelay: '<S340>/FixPt Unit Delay2' incorporates: |
| 22768 | * Constant: '<S340>/FixPt Constant' |
| 22769 | */ |
| 22770 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_j = L4_MABX_P.FixPtConstant_Value_n; |
| 22771 | |
| 22772 | /* Update for UnitDelay: '<S340>/FixPt Unit Delay1' */ |
| 22773 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_o = L4_MABX_B.If_Then_Else_n3.Switch; |
| 22774 | |
| 22775 | /* Update for UnitDelay: '<S335>/Unit_Delay' */ |
| 22776 | L4_MABX_DW.Unit_Delay_DSTATE_ll = L4_MABX_B.LogicalOperator_dm; |
| 22777 | } |
| 22778 | |
| 22779 | /* End of Update for SubSystem: '<S283>/Slew_at_event' */ |
| 22780 | |
| 22781 | /* Update for UnitDelay: '<S285>/Unit Delay' */ |
| 22782 | L4_MABX_DW.UnitDelay_DSTATE_dj = L4_MABX_B.Switch1_fi; |
| 22783 | |
| 22784 | /* Update for UnitDelay: '<S295>/Unit Delay' */ |
| 22785 | L4_MABX_DW.UnitDelay_DSTATE_m = L4_MABX_B.Add1_m; |
| 22786 | |
| 22787 | /* Update for UnitDelay: '<S296>/Unit Delay' */ |
| 22788 | L4_MABX_DW.UnitDelay_DSTATE_m0 = L4_MABX_B.Switch_ko; |
| 22789 | |
| 22790 | /* Update for UnitDelay: '<S296>/Unit Delay1' */ |
| 22791 | L4_MABX_DW.UnitDelay1_DSTATE_k = L4_MABX_B.Divide1_b; |
| 22792 | |
| 22793 | /* Update for UnitDelay: '<S290>/Unit Delay' */ |
| 22794 | L4_MABX_DW.UnitDelay_DSTATE_m1 = L4_MABX_B.Switch1_pb; |
| 22795 | |
| 22796 | /* Update for UnitDelay: '<S308>/Delay Input2' */ |
| 22797 | L4_MABX_DW.DelayInput2_DSTATE = L4_MABX_B.DifferenceInputs2; |
| 22798 | |
| 22799 | /* Update for DiscreteIntegrator: '<S307>/Integrator' */ |
| 22800 | L4_MABX_DW.Integrator_DSTATE += L4_MABX_P.Integrator_gainval * |
| 22801 | L4_MABX_B.IntegralGain; |
| 22802 | L4_MABX_DW.Integrator_PrevResetState = (int8_T)AutonomousEnabled; |
| 22803 | |
| 22804 | /* Update for DiscreteIntegrator: '<S307>/Filter' */ |
| 22805 | L4_MABX_DW.Filter_DSTATE += L4_MABX_P.Filter_gainval * |
| 22806 | L4_MABX_B.FilterCoefficient; |
| 22807 | L4_MABX_DW.Filter_PrevResetState = (int8_T)AutonomousEnabled; |
| 22808 | |
| 22809 | /* Update for UnitDelay: '<S311>/Delay Input' */ |
| 22810 | L4_MABX_DW.DelayInput_DSTATE = L4_MABX_B.Saturate; |
| 22811 | |
| 22812 | /* Update for UnitDelay: '<S311>/Delay Output' */ |
| 22813 | L4_MABX_DW.DelayOutput_DSTATE = L4_MABX_B.Downcast; |
| 22814 | |
| 22815 | /* Update for UnitDelay: '<S309>/Delay Input2' */ |
| 22816 | L4_MABX_DW.DelayInput2_DSTATE_a = L4_MABX_B.DifferenceInputs2_a; |
| 22817 | |
| 22818 | /* Update for DiscreteIntegrator: '<S301>/Discrete-Time Integrator' */ |
| 22819 | L4_MABX_DW.DiscreteTimeIntegrator_IC_LOADI = 0U; |
| 22820 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE += |
| 22821 | L4_MABX_P.DiscreteTimeIntegrator_gainval * L4_MABX_B.Gain_o; |
| 22822 | L4_MABX_DW.DiscreteTimeIntegrator_PrevRese = (int8_T)AutonomousEnabled; |
| 22823 | |
| 22824 | /* Update for UnitDelay: '<S321>/Delay Input2' */ |
| 22825 | L4_MABX_DW.DelayInput2_DSTATE_l = L4_MABX_B.DifferenceInputs2_m; |
| 22826 | |
| 22827 | /* Update for DiscreteIntegrator: '<S80>/Discrete-Time Integrator' incorporates: |
| 22828 | * Constant: '<S80>/ResetIntegrator' |
| 22829 | */ |
| 22830 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e += |
| 22831 | L4_MABX_P.DiscreteTimeIntegrator_gainva_l * L4_MABX_B.Switch1_p; |
| 22832 | if (L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e >= |
| 22833 | L4_MABX_P.DiscreteTimeIntegrator_UpperSat) { |
| 22834 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e = |
| 22835 | L4_MABX_P.DiscreteTimeIntegrator_UpperSat; |
| 22836 | } else { |
| 22837 | if (L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e <= |
| 22838 | L4_MABX_P.DiscreteTimeIntegrator_LowerSat) { |
| 22839 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e = |
| 22840 | L4_MABX_P.DiscreteTimeIntegrator_LowerSat; |
| 22841 | } |
| 22842 | } |
| 22843 | |
| 22844 | if (L4_MABX_P.ResetIntegrator_Value > 0.0) { |
| 22845 | L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e = 1; |
| 22846 | } else if (L4_MABX_P.ResetIntegrator_Value < 0.0) { |
| 22847 | L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e = -1; |
| 22848 | } else if (L4_MABX_P.ResetIntegrator_Value == 0.0) { |
| 22849 | L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e = 0; |
| 22850 | } else { |
| 22851 | L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e = 2; |
| 22852 | } |
| 22853 | |
| 22854 | /* End of Update for DiscreteIntegrator: '<S80>/Discrete-Time Integrator' */ |
| 22855 | |
| 22856 | /* Update for UnitDelay: '<S80>/Unit Delay' */ |
| 22857 | L4_MABX_DW.UnitDelay_DSTATE_e3 = L4_MABX_B.Switch2_i1; |
| 22858 | |
| 22859 | /* Update for UnitDelay: '<S373>/FixPt Unit Delay2' incorporates: |
| 22860 | * Constant: '<S373>/FixPt Constant' |
| 22861 | */ |
| 22862 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_aw = L4_MABX_P.FixPtConstant_Value_p2; |
| 22863 | |
| 22864 | /* Update for UnitDelay: '<S373>/FixPt Unit Delay1' */ |
| 22865 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_pe = L4_MABX_B.Xnew_h; |
| 22866 | |
| 22867 | /* Update for UnitDelay: '<S374>/FixPt Unit Delay2' incorporates: |
| 22868 | * Constant: '<S374>/FixPt Constant' |
| 22869 | */ |
| 22870 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_gx = L4_MABX_P.FixPtConstant_Value_el; |
| 22871 | |
| 22872 | /* Update for UnitDelay: '<S374>/FixPt Unit Delay1' */ |
| 22873 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g0 = L4_MABX_B.Xnew_f; |
| 22874 | |
| 22875 | /* Update for UnitDelay: '<S368>/Unit_Delay' */ |
| 22876 | L4_MABX_DW.Unit_Delay_DSTATE_j = L4_MABX_B.DigitalClock_d; |
| 22877 | |
| 22878 | /* End of Update for SubSystem: '<S65>/Task_10ms' */ |
| 22879 | |
| 22880 | /* Update for Atomic SubSystem: '<S849>/CAN_TX_10ms' */ |
| 22881 | |
| 22882 | /* Update for UnitDelay: '<S1006>/Unit_Delay' */ |
| 22883 | L4_MABX_DW.Unit_Delay_DSTATE_lb = L4_MABX_B.Operator_iv; |
| 22884 | |
| 22885 | /* Update for UnitDelay: '<S1007>/Unit Delay' */ |
| 22886 | L4_MABX_DW.UnitDelay_DSTATE_bi = L4_MABX_B.Switch1_b; |
| 22887 | |
| 22888 | /* End of Update for SubSystem: '<S849>/CAN_TX_10ms' */ |
| 22889 | |
| 22890 | /* Update for UnitDelay: '<S859>/Unit Delay2' */ |
| 22891 | L4_MABX_DW.UnitDelay2_DSTATE = L4_MABX_B.enTPCM; |
| 22892 | |
| 22893 | /* Update for UnitDelay: '<S859>/Unit Delay1' */ |
| 22894 | L4_MABX_DW.UnitDelay1_DSTATE_b = L4_MABX_B.TPDT_count; |
| 22895 | |
| 22896 | /* Update for UnitDelay: '<S859>/Unit Delay3' */ |
| 22897 | L4_MABX_DW.UnitDelay3_DSTATE = L4_MABX_B.enTPDT; |
| 22898 | |
| 22899 | /* Update for UnitDelay: '<S3>/Unit_Delay' incorporates: |
| 22900 | * Constant: '<S208>/Constant' |
| 22901 | * Constant: '<S80>/zero' |
| 22902 | */ |
| 22903 | L4_MABX_DW.Unit_Delay_1_DSTATE = L4_MABX_B.Subtract_c1; |
| 22904 | L4_MABX_DW.Unit_Delay_10_DSTATE = L4_MABX_B.Add1_h; |
| 22905 | L4_MABX_DW.Unit_Delay_100_DSTATE = L4_MABX_B.SFunction1_o3_lv; |
| 22906 | L4_MABX_DW.Unit_Delay_101_DSTATE = L4_MABX_B.SPN514_NominalFrictionPercentTo; |
| 22907 | L4_MABX_DW.Unit_Delay_102_DSTATE = L4_MABX_B.SPN2978_EstEngParasiticLossesPe; |
| 22908 | L4_MABX_DW.Unit_Delay_103_DSTATE = L4_MABX_B.SPN1760_GrossCombinationVehicle; |
| 22909 | L4_MABX_DW.Unit_Delay_104_DSTATE = L4_MABX_B.ACCDistanceAlertSignal; |
| 22910 | L4_MABX_DW.Unit_Delay_105_DSTATE = L4_MABX_B.ForwardCollisionWarning; |
| 22911 | L4_MABX_DW.Unit_Delay_106_DSTATE = L4_MABX_B.SPN544_EngineReferenceTorque; |
| 22912 | L4_MABX_DW.Unit_Delay_107_DSTATE = L4_MABX_B.SFunction1_o4_bm; |
| 22913 | L4_MABX_DW.Unit_Delay_108_DSTATE = L4_MABX_B.SFunction1_o5_b; |
| 22914 | L4_MABX_DW.Unit_Delay_109_DSTATE = L4_MABX_B.SFunction1_o6_e; |
| 22915 | L4_MABX_DW.Unit_Delay_11_DSTATE = L4_MABX_B.Switch2_i1; |
| 22916 | L4_MABX_DW.Unit_Delay_110_DSTATE = L4_MABX_B.SFunction1_o7_a; |
| 22917 | L4_MABX_DW.Unit_Delay_111_DSTATE = SteerWheelAngle; |
| 22918 | L4_MABX_DW.Unit_Delay_112_DSTATE = YawRate; |
| 22919 | L4_MABX_DW.Unit_Delay_113_DSTATE = SPN1810_LongitudinalAcceleration; |
| 22920 | L4_MABX_DW.Unit_Delay_114_DSTATE = L4_MABX_B.SFunction1_o2_gl; |
| 22921 | L4_MABX_DW.Unit_Delay_115_DSTATE = L4_MABX_B.SFunction1_o3_gw; |
| 22922 | L4_MABX_DW.Unit_Delay_116_DSTATE = L4_MABX_B.SFunction1_o5_d; |
| 22923 | L4_MABX_DW.Unit_Delay_117_DSTATE = L4_MABX_B.SFunction1_o1_ps; |
| 22924 | L4_MABX_DW.Unit_Delay_118_DSTATE = L4_MABX_B.SFunction1_o3_b1; |
| 22925 | L4_MABX_DW.Unit_Delay_119_DSTATE = L4_MABX_B.LogicalOperator1_e; |
| 22926 | L4_MABX_DW.Unit_Delay_12_DSTATE = L4_MABX_B.DiscreteTimeIntegrator_h; |
| 22927 | L4_MABX_DW.Unit_Delay_120_DSTATE = L4_MABX_B.LogicalOperator1_a; |
| 22928 | L4_MABX_DW.Unit_Delay_121_DSTATE = L4_MABX_B.PitchAngleExRange; |
| 22929 | L4_MABX_DW.Unit_Delay_122_DSTATE = L4_MABX_B.SFunction1_o3_pj; |
| 22930 | L4_MABX_DW.Unit_Delay_123_DSTATE = L4_MABX_B.SFunction1_o1_d5; |
| 22931 | L4_MABX_DW.Unit_Delay_124_DSTATE = L4_MABX_B.SFunction1_o2_b; |
| 22932 | L4_MABX_DW.Unit_Delay_125_DSTATE = L4_MABX_B.Latitude_; |
| 22933 | L4_MABX_DW.Unit_Delay_126_DSTATE = L4_MABX_B.Longitude_; |
| 22934 | L4_MABX_DW.Unit_Delay_127_DSTATE = L4_MABX_B.HDOP_; |
| 22935 | L4_MABX_DW.Unit_Delay_128_DSTATE = L4_MABX_B.XPRControlMode; |
| 22936 | L4_MABX_DW.Unit_Delay_129_DSTATE = L4_MABX_B.XPRErrorState; |
| 22937 | L4_MABX_DW.Unit_Delay_13_DSTATE = L4_MABX_B.numLanePoints_j; |
| 22938 | L4_MABX_DW.Unit_Delay_130_DSTATE = L4_MABX_B.PressureP1; |
| 22939 | L4_MABX_DW.Unit_Delay_131_DSTATE = L4_MABX_B.PressureP4; |
| 22940 | L4_MABX_DW.Unit_Delay_132_DSTATE = L4_MABX_B.PressureP21; |
| 22941 | L4_MABX_DW.Unit_Delay_133_DSTATE = L4_MABX_B.PressureP22; |
| 22942 | L4_MABX_DW.Unit_Delay_134_DSTATE = L4_MABX_B.PressureP42; |
| 22943 | L4_MABX_DW.Unit_Delay_135_DSTATE = ReAX_ActualHandwheelPos; |
| 22944 | L4_MABX_DW.Unit_Delay_136_DSTATE = ReAX_EchoedSteerWheelPos; |
| 22945 | L4_MABX_DW.Unit_Delay_137_DSTATE = L4_MABX_B.SystemsOk; |
| 22946 | L4_MABX_DW.Unit_Delay_138_DSTATE = SupervisorMode; |
| 22947 | L4_MABX_DW.Unit_Delay_139_DSTATE = CurrentAzimuth_rad; |
| 22948 | L4_MABX_DW.Unit_Delay_14_DSTATE = L4_MABX_B.correctedError; |
| 22949 | L4_MABX_DW.Unit_Delay_140_DSTATE = TargetAzimuth_rad; |
| 22950 | L4_MABX_DW.Unit_Delay_141_DSTATE = CurrentVelocity_kph; |
| 22951 | L4_MABX_DW.Unit_Delay_142_DSTATE = TargetVelocity_kph; |
| 22952 | L4_MABX_DW.Unit_Delay_143_DSTATE = Curvature; |
| 22953 | L4_MABX_DW.Unit_Delay_144_DSTATE = CrosstrackError; |
| 22954 | L4_MABX_DW.Unit_Delay_15_DSTATE = L4_MABX_B.Switch1_j; |
| 22955 | L4_MABX_DW.Unit_Delay_16_DSTATE = L4_MABX_B.rad2deg1; |
| 22956 | L4_MABX_DW.Unit_Delay_17_DSTATE = L4_MABX_B.If_Then_Else_i.Switch; |
| 22957 | L4_MABX_DW.Unit_Delay_18_DSTATE = L4_MABX_B.APTC_arb_pedal_low_idl_sw_o; |
| 22958 | L4_MABX_DW.Unit_Delay_19_DSTATE = L4_MABX_B.If_Then_Else_f.Switch; |
| 22959 | L4_MABX_DW.Unit_Delay_2_DSTATE = L4_MABX_B.Add3; |
| 22960 | L4_MABX_DW.Unit_Delay_20_DSTATE = L4_MABX_P.Constant_Value_jg4; |
| 22961 | L4_MABX_DW.Unit_Delay_21_DSTATE = L4_MABX_B.If_Then_Else_pi.Switch; |
| 22962 | L4_MABX_DW.Unit_Delay_22_DSTATE = L4_MABX_B.Add_ds; |
| 22963 | L4_MABX_DW.Unit_Delay_23_DSTATE = L4_MABX_B.If_Then_Else_k2t.Switch; |
| 22964 | L4_MABX_DW.Unit_Delay_24_DSTATE = L4_MABX_B.Product_i; |
| 22965 | L4_MABX_DW.Unit_Delay_25_DSTATE = L4_MABX_B.PID_i_term_c; |
| 22966 | L4_MABX_DW.Unit_Delay_26_DSTATE = L4_MABX_B.PID_d_term_c; |
| 22967 | L4_MABX_DW.Unit_Delay_27_DSTATE = L4_MABX_B.PID_hold_i_term_f_b; |
| 22968 | L4_MABX_DW.Unit_Delay_28_DSTATE = L4_MABX_B.ThrottlePID_Y_m; |
| 22969 | L4_MABX_DW.Unit_Delay_29_DSTATE = L4_MABX_B.MinMax1_n; |
| 22970 | L4_MABX_DW.Unit_Delay_3_DSTATE = L4_MABX_B.Add_px; |
| 22971 | L4_MABX_DW.Unit_Delay_30_DSTATE = L4_MABX_B.F_Ignition_relay_command_i; |
| 22972 | L4_MABX_DW.Unit_Delay_31_DSTATE = L4_MABX_B.F_Inverter_relay_command_p; |
| 22973 | L4_MABX_DW.Unit_Delay_32_DSTATE = L4_MABX_B.F_MABX_relay_command_n; |
| 22974 | L4_MABX_DW.Unit_Delay_33_DSTATE = L4_MABX_B.F_Sensor_relay_command_k; |
| 22975 | L4_MABX_DW.Unit_Delay_34_DSTATE = L4_MABX_B.BrkPedArbBrakeSwitch_c; |
| 22976 | L4_MABX_DW.Unit_Delay_35_DSTATE = L4_MABX_B.Diff; |
| 22977 | L4_MABX_DW.Unit_Delay_36_DSTATE = L4_MABX_B.F_Brake_control_active; |
| 22978 | L4_MABX_DW.Unit_Delay_37_DSTATE = L4_MABX_B.F_Hold_brakes_at_zero_d; |
| 22979 | L4_MABX_DW.Unit_Delay_38_DSTATE = L4_MABX_B.BrakingPID_Y_k; |
| 22980 | L4_MABX_DW.Unit_Delay_39_DSTATE = 0.0; |
| 22981 | L4_MABX_DW.Unit_Delay_4_DSTATE = L4_MABX_B.Product_d; |
| 22982 | L4_MABX_DW.Unit_Delay_40_DSTATE = L4_MABX_B.VSPD_TARGET_KPH_APV_g; |
| 22983 | L4_MABX_DW.Unit_Delay_41_DSTATE = L4_MABX_B.Vehicle_speed_target_n; |
| 22984 | L4_MABX_DW.Unit_Delay_42_DSTATE = L4_MABX_B.VSPD_HYST_KPH_APV_f; |
| 22985 | L4_MABX_DW.Unit_Delay_43_DSTATE = L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b; |
| 22986 | L4_MABX_DW.Unit_Delay_44_DSTATE = L4_MABX_B.ACCEL_LIM_MS2_APV_b; |
| 22987 | L4_MABX_DW.Unit_Delay_46_DSTATE = AutonomousOutputEnabled; |
| 22988 | L4_MABX_DW.Unit_Delay_5_DSTATE = L4_MABX_B.Switch2_i; |
| 22989 | L4_MABX_DW.Unit_Delay_6_DSTATE = L4_MABX_B.Conversion; |
| 22990 | L4_MABX_DW.Unit_Delay_7_DSTATE = L4_MABX_B.Add2; |
| 22991 | L4_MABX_DW.Unit_Delay_8_DSTATE = L4_MABX_P.zero_Value; |
| 22992 | L4_MABX_DW.Unit_Delay_82_DSTATE = EngagePB; |
| 22993 | L4_MABX_DW.Unit_Delay_85_DSTATE = Pedal_pwm_position; |
| 22994 | L4_MABX_DW.Unit_Delay_86_DSTATE = L4_MABX_B.IgnitionKeySwitch_voltage; |
| 22995 | L4_MABX_DW.Unit_Delay_87_DSTATE = L4_MABX_B.SFunction1_o8_fx; |
| 22996 | L4_MABX_DW.Unit_Delay_88_DSTATE = L4_MABX_B.SFunction1_o2_bb; |
| 22997 | L4_MABX_DW.Unit_Delay_89_DSTATE = L4_MABX_B.SFunction1_o7_oi; |
| 22998 | L4_MABX_DW.Unit_Delay_9_DSTATE = L4_MABX_B.Add1_h; |
| 22999 | L4_MABX_DW.Unit_Delay_90_DSTATE = L4_MABX_B.SFunction1_o1_ee; |
| 23000 | L4_MABX_DW.Unit_Delay_91_DSTATE = L4_MABX_B.SFunction1_o1_ag; |
| 23001 | L4_MABX_DW.Unit_Delay_92_DSTATE = L4_MABX_B.SFunction1_o2_na; |
| 23002 | L4_MABX_DW.Unit_Delay_93_DSTATE = L4_MABX_B.SFunction1_o4_mt; |
| 23003 | L4_MABX_DW.Unit_Delay_94_DSTATE = L4_MABX_B.SPN524_TransSelectedGear; |
| 23004 | L4_MABX_DW.Unit_Delay_95_DSTATE = L4_MABX_B.SPN523_TransCurrentGear; |
| 23005 | L4_MABX_DW.Unit_Delay_96_DSTATE = L4_MABX_B.SPN526_TransActualGearRatio; |
| 23006 | L4_MABX_DW.Unit_Delay_97_DSTATE = L4_MABX_B.SFunction1_o4_jq; |
| 23007 | L4_MABX_DW.Unit_Delay_98_DSTATE = L4_MABX_B.SFunction1_o2_eg; |
| 23008 | L4_MABX_DW.Unit_Delay_99_DSTATE = L4_MABX_B.SFunction1_o5_l; |
| 23009 | |
| 23010 | /* Update for UnitDelay: '<S649>/Unit_Delay2' */ |
| 23011 | L4_MABX_DW.Unit_Delay2_DSTATE_d0 = L4_MABX_B.LogicalOperator2_a; |
| 23012 | |
| 23013 | /* Update for UnitDelay: '<S649>/Unit_Delay1' incorporates: |
| 23014 | * Constant: '<S649>/Constant1' |
| 23015 | */ |
| 23016 | L4_MABX_DW.Unit_Delay1_DSTATE_d = L4_MABX_P.Constant1_Value_md; |
| 23017 | |
| 23018 | /* Update for UnitDelay: '<S656>/Unit_Delay' */ |
| 23019 | L4_MABX_DW.Unit_Delay_DSTATE_n = L4_MABX_B.LogicalOperator1_a; |
| 23020 | |
| 23021 | /* Update for UnitDelay: '<S747>/Delay Input1' */ |
| 23022 | L4_MABX_DW.DelayInput1_DSTATE_b = L4_MABX_B.Compare_ks; |
| 23023 | |
| 23024 | /* Update for UnitDelay: '<S748>/Unit Delay' */ |
| 23025 | L4_MABX_DW.UnitDelay_DSTATE_d = L4_MABX_B.Switch_p1; |
| 23026 | |
| 23027 | /* Update for UnitDelay: '<S742>/Unit Delay' */ |
| 23028 | L4_MABX_DW.UnitDelay_DSTATE_ig = L4_MABX_B.AND_fp; |
| 23029 | |
| 23030 | /* Update for UnitDelay: '<S746>/Delay Input1' */ |
| 23031 | L4_MABX_DW.DelayInput1_DSTATE_fl = L4_MABX_B.Compare_go; |
| 23032 | |
| 23033 | /* Update for UnitDelay: '<S748>/Unit Delay1' */ |
| 23034 | L4_MABX_DW.UnitDelay1_DSTATE_m0 = L4_MABX_B.AND_n; |
| 23035 | |
| 23036 | /* Update for UnitDelay: '<S749>/Unit Delay' */ |
| 23037 | L4_MABX_DW.UnitDelay_DSTATE_e = L4_MABX_B.Switch_e; |
| 23038 | |
| 23039 | /* Update for UnitDelay: '<S749>/Unit Delay1' */ |
| 23040 | L4_MABX_DW.UnitDelay1_DSTATE_l = L4_MABX_B.AND_fp; |
| 23041 | |
| 23042 | /* Update for UnitDelay: '<S10>/Unit_Delay' incorporates: |
| 23043 | * Constant: '<S10>/Constant' |
| 23044 | */ |
| 23045 | L4_MABX_DW.Unit_Delay_DSTATE_do = L4_MABX_P.Constant_Value_g5; |
| 23046 | |
| 23047 | /* Update absolute time */ |
| 23048 | /* The "clockTick0" counts the number of times the code of this task has |
| 23049 | * been executed. The absolute time is the multiplication of "clockTick0" |
| 23050 | * and "Timing.stepSize0". Size of "clockTick0" ensures timer will not |
| 23051 | * overflow during the application lifespan selected. |
| 23052 | * Timer of this task consists of two 32 bit unsigned integers. |
| 23053 | * The two integers represent the low bits Timing.clockTick0 and the high bits |
| 23054 | * Timing.clockTickH0. When the low bit overflows to 0, the high bits increment. |
| 23055 | */ |
| 23056 | if (!(++L4_MABX_M->Timing.clockTick0)) { |
| 23057 | ++L4_MABX_M->Timing.clockTickH0; |
| 23058 | } |
| 23059 | |
| 23060 | L4_MABX_M->Timing.t[0] = L4_MABX_M->Timing.clockTick0 * |
| 23061 | L4_MABX_M->Timing.stepSize0 + L4_MABX_M->Timing.clockTickH0 * |
| 23062 | L4_MABX_M->Timing.stepSize0 * 4294967296.0; |
| 23063 | } |
| 23064 | |
| 23065 | /* Model output function for TID1 */ |
| 23066 | void L4_MABX_output1(void) /* Sample time: [0.02s, 0.0s] */ |
| 23067 | { |
| 23068 | int_T tid = 1; |
| 23069 | int32_T i; |
| 23070 | uint32_T q0; |
| 23071 | uint32_T qY; |
| 23072 | uint8_T tmp; |
| 23073 | real_T u0; |
| 23074 | real_T u1; |
| 23075 | real_T u2; |
| 23076 | |
| 23077 | /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_20ms' */ |
| 23078 | |
| 23079 | /* Switch: '<S1015>/Switch1' incorporates: |
| 23080 | * Constant: '<S1015>/Constant4' |
| 23081 | */ |
| 23082 | if (L4_MABX_B.AutonomousOutputEnabled_n1) { |
| 23083 | /* Product: '<S1015>/Divide1' incorporates: |
| 23084 | * Constant: '<S1015>/Constant2' |
| 23085 | */ |
| 23086 | L4_MABX_B.XBRExternalAccelDemand_m = L4_MABX_B.BrakingPID_Y_g * |
| 23087 | L4_MABX_P.Constant2_Value_hw; |
| 23088 | L4_MABX_B.XBRExternalAccelDemand = L4_MABX_B.XBRExternalAccelDemand_m; |
| 23089 | } else { |
| 23090 | L4_MABX_B.XBRExternalAccelDemand = L4_MABX_P.Constant4_Value_g; |
| 23091 | } |
| 23092 | |
| 23093 | /* End of Switch: '<S1015>/Switch1' */ |
| 23094 | |
| 23095 | /* MultiPortSwitch: '<S1015>/Multiport Switch' incorporates: |
| 23096 | * Constant: '<S1015>/Constant10' |
| 23097 | * Constant: '<S1015>/Constant7' |
| 23098 | * Constant: '<S1015>/Constant8' |
| 23099 | * Constant: '<S1015>/Constant9' |
| 23100 | */ |
| 23101 | switch ((int32_T)L4_MABX_B.BrakingControlActive_d) { |
| 23102 | case 0: |
| 23103 | L4_MABX_B.XBRPassThroughActive = L4_MABX_P.Constant10_Value_k; |
| 23104 | break; |
| 23105 | |
| 23106 | case 1: |
| 23107 | L4_MABX_B.XBRPassThroughActive = L4_MABX_P.Constant7_Value_d; |
| 23108 | break; |
| 23109 | |
| 23110 | case 2: |
| 23111 | L4_MABX_B.XBRPassThroughActive = L4_MABX_P.Constant8_Value_a; |
| 23112 | break; |
| 23113 | |
| 23114 | default: |
| 23115 | L4_MABX_B.XBRPassThroughActive = L4_MABX_P.Constant9_Value_d; |
| 23116 | break; |
| 23117 | } |
| 23118 | |
| 23119 | /* End of MultiPortSwitch: '<S1015>/Multiport Switch' */ |
| 23120 | |
| 23121 | /* Outputs for Atomic SubSystem: '<S1015>/If_Then_Else' */ |
| 23122 | |
| 23123 | /* Constant: '<S1015>/XBRValueOverride' incorporates: |
| 23124 | * Constant: '<S1015>/XBRControlMode' |
| 23125 | * Constant: '<S1015>/XBRControlModeOVR' |
| 23126 | * Constant: '<S1015>/XBREnduranceBrakeIntegrationMode' |
| 23127 | * Constant: '<S1015>/XBREnduranceBrakeIntegrationModeOVR' |
| 23128 | * Constant: '<S1015>/XBRExternalAccelDemandOVR' |
| 23129 | * Constant: '<S1015>/XBRPassThroughActiveOVR' |
| 23130 | * Constant: '<S1015>/XBRPassThroughEnabled' |
| 23131 | * Constant: '<S1015>/XBRPassThroughEnabledOVR' |
| 23132 | * Constant: '<S1015>/XBRPriority' |
| 23133 | * Constant: '<S1015>/XBRPriorityOVR' |
| 23134 | * Constant: '<S1015>/XBRUrgency' |
| 23135 | * Constant: '<S1015>/XBRUrgencyOVR' |
| 23136 | */ |
| 23137 | L4_MABX_If_Then_Else_o(L4_MABX_P.XBRValueOverride_Value, |
| 23138 | L4_MABX_P.XBRExternalAccelDemandOVR_Value, |
| 23139 | L4_MABX_P.XBREnduranceBrakeIntegrationMod, L4_MABX_P.XBRPriorityOVR_Value, |
| 23140 | L4_MABX_P.XBRControlModeOVR_Value, L4_MABX_P.XBRPassThroughActiveOVR_Value, |
| 23141 | L4_MABX_P.XBRUrgencyOVR_Value, L4_MABX_P.XBRPassThroughEnabledOVR_Value, |
| 23142 | L4_MABX_B.XBRExternalAccelDemand, L4_MABX_P.XBREnduranceBrakeIntegrationM_h, |
| 23143 | L4_MABX_P.XBRPriority_Value, L4_MABX_P.XBRControlMode_Value, |
| 23144 | L4_MABX_B.XBRPassThroughActive, L4_MABX_P.XBRUrgency_Value, |
| 23145 | L4_MABX_P.XBRPassThroughEnabled_Value, &L4_MABX_B.If_Then_Else_ob); |
| 23146 | |
| 23147 | /* End of Outputs for SubSystem: '<S1015>/If_Then_Else' */ |
| 23148 | |
| 23149 | /* DataTypeConversion: '<S1018>/Data Type Conversion1' */ |
| 23150 | L4_MABX_B.DataTypeConversion1_b = (real_T) |
| 23151 | L4_MABX_B.If_Then_Else_ob.XBREnduranceBrakeIntegrationMod; |
| 23152 | |
| 23153 | /* DataTypeConversion: '<S1018>/Data Type Conversion2' */ |
| 23154 | L4_MABX_B.DataTypeConversion2_c0 = (real_T) |
| 23155 | L4_MABX_B.If_Then_Else_ob.XBRPriority; |
| 23156 | |
| 23157 | /* DataTypeConversion: '<S1018>/Data Type Conversion3' */ |
| 23158 | L4_MABX_B.DataTypeConversion3_l = (real_T) |
| 23159 | L4_MABX_B.If_Then_Else_ob.XBRControlMode; |
| 23160 | |
| 23161 | /* DataTypeConversion: '<S1018>/Data Type Conversion4' */ |
| 23162 | L4_MABX_B.DataTypeConversion4_n = |
| 23163 | L4_MABX_B.If_Then_Else_ob.XBRExternalAccelDemand; |
| 23164 | |
| 23165 | /* DataTypeConversion: '<S1018>/Data Type Conversion5' */ |
| 23166 | L4_MABX_B.DataTypeConversion5_d = (real_T) |
| 23167 | L4_MABX_B.If_Then_Else_ob.XBRPassThroughActive; |
| 23168 | |
| 23169 | /* DataTypeConversion: '<S1018>/Data Type Conversion6' */ |
| 23170 | L4_MABX_B.DataTypeConversion6_j = L4_MABX_B.If_Then_Else_ob.XBRUrgency; |
| 23171 | |
| 23172 | /* DataTypeConversion: '<S1018>/Data Type Conversion7' */ |
| 23173 | L4_MABX_B.DataTypeConversion7_n = |
| 23174 | L4_MABX_B.If_Then_Else_ob.XBRPassThroughEnabled; |
| 23175 | |
| 23176 | /* UnitDelay: '<S1011>/Unit_Delay' */ |
| 23177 | L4_MABX_B.Unit_Delay_o = L4_MABX_DW.Unit_Delay_DSTATE_id; |
| 23178 | |
| 23179 | /* Logic: '<S1011>/Logical Operator8' */ |
| 23180 | L4_MABX_B.LogicalOperator8_d = !L4_MABX_B.TmpRTBAtLogicalOperator8Inport1; |
| 23181 | |
| 23182 | /* Logic: '<S1011>/Logical Operator7' */ |
| 23183 | L4_MABX_B.LogicalOperator7_m = (L4_MABX_B.Unit_Delay_o && |
| 23184 | L4_MABX_B.LogicalOperator8_d); |
| 23185 | |
| 23186 | /* Logic: '<S1011>/Logical Operator1' */ |
| 23187 | L4_MABX_B.LogicalOperator1_p = (L4_MABX_B.LogicalOperator7_m || |
| 23188 | L4_MABX_B.TmpRTBAtLogicalOperator1Inport2); |
| 23189 | |
| 23190 | /* DataTypeConversion: '<S1011>/Data Type Conversion' incorporates: |
| 23191 | * Constant: '<S855>/CANT_PROPB_XBR_B3_CHANNEL_APV' |
| 23192 | */ |
| 23193 | u0 = L4_MABX_P.CANT_PROPB_XBR_B3_CHANNEL_APV_V; |
| 23194 | if (u0 < 256.0) { |
| 23195 | if (u0 >= 0.0) { |
| 23196 | tmp = (uint8_T)u0; |
| 23197 | } else { |
| 23198 | tmp = 0U; |
| 23199 | } |
| 23200 | } else { |
| 23201 | tmp = MAX_uint8_T; |
| 23202 | } |
| 23203 | |
| 23204 | L4_MABX_B.DataTypeConversion_a0 = tmp; |
| 23205 | |
| 23206 | /* End of DataTypeConversion: '<S1011>/Data Type Conversion' */ |
| 23207 | |
| 23208 | /* S-Function (sfix_bitop): '<S1016>/Operator' */ |
| 23209 | L4_MABX_B.Operator_ls = (uint8_T)(L4_MABX_B.DataTypeConversion_a0 & |
| 23210 | L4_MABX_P.Operator_BitMask_np); |
| 23211 | |
| 23212 | /* DataTypeConversion: '<S1016>/DataType' */ |
| 23213 | L4_MABX_B.DataType_o1 = L4_MABX_B.Operator_ls; |
| 23214 | |
| 23215 | /* DataTypeConversion: '<S1011>/Data Type Conversion2' */ |
| 23216 | L4_MABX_B.DataTypeConversion2_ed = (L4_MABX_B.DataType_o1 != 0); |
| 23217 | |
| 23218 | /* Logic: '<S1011>/Logical Operator' */ |
| 23219 | L4_MABX_B.LogicalOperator_gg = (L4_MABX_B.LogicalOperator1_p && |
| 23220 | L4_MABX_B.DataTypeConversion2_ed); |
| 23221 | |
| 23222 | /* Outputs for Enabled SubSystem: '<S1018>/PropB_XBR_B3' incorporates: |
| 23223 | * EnablePort: '<S1019>/Enable' |
| 23224 | */ |
| 23225 | if (L4_MABX_B.LogicalOperator_gg) { |
| 23226 | /* S-Function (rti_commonblock): '<S1019>/S-Function1' */ |
| 23227 | /* This comment workarounds a code generation problem */ |
| 23228 | |
| 23229 | /* dSPACE RTICAN TX Message Block: "PropB_XBR_B3" Id:218038707 */ |
| 23230 | { |
| 23231 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 23232 | |
| 23233 | Float32 delayTime = 0.0; |
| 23234 | |
| 23235 | /* ... Read status and timestamp info (previous message) */ |
| 23236 | can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]); |
| 23237 | |
| 23238 | /* Convert timestamp */ |
| 23239 | if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->processed) { |
| 23240 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->timestamp = |
| 23241 | rtk_dsts_time_to_simtime_convert |
| 23242 | (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->timestamp); |
| 23243 | } |
| 23244 | |
| 23245 | /* Messages with timestamp zero have been received in pause/stop state |
| 23246 | and must not be handled. |
| 23247 | */ |
| 23248 | if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->timestamp > 0.0) { |
| 23249 | L4_MABX_B.SFunction1_o1_mx = (real_T) |
| 23250 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->processed; |
| 23251 | L4_MABX_B.SFunction1_o2_cq = (real_T) |
| 23252 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->timestamp; |
| 23253 | L4_MABX_B.SFunction1_o3_oe = (real_T) |
| 23254 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->deltatime; |
| 23255 | L4_MABX_B.SFunction1_o4_aw = (real_T) |
| 23256 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->delaytime; |
| 23257 | } |
| 23258 | |
| 23259 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 23260 | { |
| 23261 | rtican_Signal_t CAN_Sgn; |
| 23262 | |
| 23263 | /* ...... "SPN2920_ExternalAccelerationDemand" (0|16, standard signal, unsigned int, little endian) */ |
| 23264 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23265 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion4_n - |
| 23266 | ( -15.687 ) ) / 0.00048828125 + 0.5); |
| 23267 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 23268 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 23269 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte1; |
| 23270 | |
| 23271 | /* ...... "SPN2915_XBREnduranceBrkIntegrationMode" (16|2, standard signal, unsigned int, little endian) */ |
| 23272 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23273 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_b ) + |
| 23274 | 0.5); |
| 23275 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 23276 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 23277 | |
| 23278 | /* ...... "SPN2915_XBRPriority" (18|2, standard signal, unsigned int, little endian) */ |
| 23279 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23280 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion2_c0 ) + |
| 23281 | 0.5); |
| 23282 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 23283 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 23284 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 23285 | |
| 23286 | /* ...... "SPN2916_XBRControlMode" (20|2, standard signal, unsigned int, little endian) */ |
| 23287 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23288 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion3_l ) + |
| 23289 | 0.5); |
| 23290 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 23291 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 23292 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 23293 | |
| 23294 | /* ...... "XBRPassThroughActive" (22|2, standard signal, unsigned int, little endian) */ |
| 23295 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23296 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion5_d ) + |
| 23297 | 0.5); |
| 23298 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 23299 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 23300 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 23301 | |
| 23302 | /* ...... "SPN4099_XBRUrgency" (24|8, standard signal, unsigned int, little endian) */ |
| 23303 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23304 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion6_j - ( 0 ) |
| 23305 | ) / 0.4 + 0.5); |
| 23306 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 23307 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 23308 | |
| 23309 | /* ...... "XBRPassThroughEnable" (54|2, standard signal, unsigned int, little endian) */ |
| 23310 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23311 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion7_n ) + |
| 23312 | 0.5); |
| 23313 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 23314 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 23315 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 23316 | } |
| 23317 | |
| 23318 | /* mask unused bits with '1' */ |
| 23319 | CAN_Msg[4] |= 0xFF; |
| 23320 | CAN_Msg[5] |= 0xFF; |
| 23321 | CAN_Msg[6] |= 0x3F; |
| 23322 | CAN_Msg[7] |= 0xFF; |
| 23323 | |
| 23324 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 23325 | can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3], 8, |
| 23326 | &(CAN_Msg[0]), delayTime); |
| 23327 | } |
| 23328 | } |
| 23329 | |
| 23330 | /* End of Outputs for SubSystem: '<S1018>/PropB_XBR_B3' */ |
| 23331 | |
| 23332 | /* RelationalOperator: '<S1017>/Compare' incorporates: |
| 23333 | * Constant: '<S1017>/Constant' |
| 23334 | */ |
| 23335 | L4_MABX_B.Compare_ot = (L4_MABX_B.If_Then_Else_ob.XBRPassThroughActive == |
| 23336 | L4_MABX_P.CompareToConstant_const_p); |
| 23337 | |
| 23338 | /* Saturate: '<S1014>/Saturation' incorporates: |
| 23339 | * Constant: '<S1014>/2C2_OR_VALUE_APV' |
| 23340 | */ |
| 23341 | u0 = L4_MABX_P.uC2_OR_VALUE_APV_Value; |
| 23342 | u1 = L4_MABX_P.Saturation_LowerSat_h; |
| 23343 | u2 = L4_MABX_P.Saturation_UpperSat_g; |
| 23344 | if (u0 > u2) { |
| 23345 | L4_MABX_B.Saturation_d = u2; |
| 23346 | } else if (u0 < u1) { |
| 23347 | L4_MABX_B.Saturation_d = u1; |
| 23348 | } else { |
| 23349 | L4_MABX_B.Saturation_d = u0; |
| 23350 | } |
| 23351 | |
| 23352 | /* End of Saturate: '<S1014>/Saturation' */ |
| 23353 | |
| 23354 | /* Outputs for Atomic SubSystem: '<S1014>/If_Then_Else1' */ |
| 23355 | |
| 23356 | /* Constant: '<S1014>/F_2C2_OR_APV' */ |
| 23357 | L4_MABX_If_Then_Else_g(L4_MABX_P.F_2C2_OR_APV_Value, L4_MABX_B.Saturation_d, |
| 23358 | L4_MABX_B.BrakingPID_Y_gr, &L4_MABX_B.If_Then_Else1_g0); |
| 23359 | |
| 23360 | /* End of Outputs for SubSystem: '<S1014>/If_Then_Else1' */ |
| 23361 | |
| 23362 | /* Gain: '<S1014>/Gain' */ |
| 23363 | L4_MABX_B.Gain_lo = L4_MABX_P.Gain_Gain_e * L4_MABX_B.If_Then_Else1_g0.Switch; |
| 23364 | |
| 23365 | /* Gain: '<S1031>/Gain' */ |
| 23366 | L4_MABX_B.Gain_g = L4_MABX_P.Gain_Gain_n3 * L4_MABX_B.Gain_lo; |
| 23367 | |
| 23368 | /* DataTypeConversion: '<S1031>/Data Type Conversion2' */ |
| 23369 | u0 = floor(L4_MABX_B.Gain_g); |
| 23370 | if (rtIsNaN(u0) || rtIsInf(u0)) { |
| 23371 | u0 = 0.0; |
| 23372 | } else { |
| 23373 | u0 = fmod(u0, 256.0); |
| 23374 | } |
| 23375 | |
| 23376 | L4_MABX_B.DataTypeConversion2_oy = (uint8_T)(u0 < 0.0 ? (int32_T)(uint8_T) |
| 23377 | -(int8_T)(uint8_T)-u0 : (int32_T)(uint8_T)u0); |
| 23378 | |
| 23379 | /* End of DataTypeConversion: '<S1031>/Data Type Conversion2' */ |
| 23380 | |
| 23381 | /* DataTypeConversion: '<S1031>/Data Type Conversion3' incorporates: |
| 23382 | * Constant: '<S1014>/BrkControlMode_Active' |
| 23383 | */ |
| 23384 | u0 = floor(L4_MABX_P.BrkControlMode_Active_Value); |
| 23385 | if (rtIsNaN(u0) || rtIsInf(u0)) { |
| 23386 | u0 = 0.0; |
| 23387 | } else { |
| 23388 | u0 = fmod(u0, 256.0); |
| 23389 | } |
| 23390 | |
| 23391 | L4_MABX_B.DataTypeConversion3_d = (uint8_T)(u0 < 0.0 ? (int32_T)(uint8_T) |
| 23392 | -(int8_T)(uint8_T)-u0 : (int32_T)(uint8_T)u0); |
| 23393 | |
| 23394 | /* End of DataTypeConversion: '<S1031>/Data Type Conversion3' */ |
| 23395 | |
| 23396 | /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator14' */ |
| 23397 | L4_MABX_B.BitwiseOperator14 = (uint8_T)(L4_MABX_B.DataTypeConversion3_d & |
| 23398 | L4_MABX_P.BitwiseOperator14_BitMask); |
| 23399 | |
| 23400 | /* DataTypeConversion: '<S1031>/Data Type Conversion4' incorporates: |
| 23401 | * Constant: '<S1014>/BrkControlPriority' |
| 23402 | */ |
| 23403 | u0 = floor(L4_MABX_P.BrkControlPriority_Value); |
| 23404 | if (rtIsNaN(u0) || rtIsInf(u0)) { |
| 23405 | u0 = 0.0; |
| 23406 | } else { |
| 23407 | u0 = fmod(u0, 256.0); |
| 23408 | } |
| 23409 | |
| 23410 | L4_MABX_B.DataTypeConversion4_le = (uint8_T)(u0 < 0.0 ? (int32_T)(uint8_T) |
| 23411 | -(int8_T)(uint8_T)-u0 : (int32_T)(uint8_T)u0); |
| 23412 | |
| 23413 | /* End of DataTypeConversion: '<S1031>/Data Type Conversion4' */ |
| 23414 | |
| 23415 | /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator1' */ |
| 23416 | L4_MABX_B.BitwiseOperator1 = (uint8_T)(L4_MABX_B.DataTypeConversion4_le & |
| 23417 | L4_MABX_P.BitwiseOperator1_BitMask); |
| 23418 | |
| 23419 | /* ArithShift: '<S1031>/Shift_Arithmetic ' */ |
| 23420 | L4_MABX_B.Shift_Arithmetic_j3 = (uint8_T)(L4_MABX_B.BitwiseOperator1 << 2); |
| 23421 | |
| 23422 | /* DataTypeConversion: '<S1031>/Data Type Conversion12' */ |
| 23423 | L4_MABX_B.DataTypeConversion12_l = L4_MABX_B.Shift_Arithmetic_j3; |
| 23424 | |
| 23425 | /* DataTypeConversion: '<S1031>/Data Type Conversion6' incorporates: |
| 23426 | * Constant: '<S1031>/Constant2' |
| 23427 | */ |
| 23428 | L4_MABX_B.DataTypeConversion6_ca = L4_MABX_P.Constant2_Value_fn; |
| 23429 | |
| 23430 | /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator17' */ |
| 23431 | L4_MABX_B.BitwiseOperator17_g = (uint8_T)(L4_MABX_B.BitwiseOperator14 | |
| 23432 | L4_MABX_B.DataTypeConversion12_l | L4_MABX_B.DataTypeConversion6_ca); |
| 23433 | |
| 23434 | /* Gain: '<S1031>/Gain1' incorporates: |
| 23435 | * Constant: '<S1014>/BrkControl_RearAxlePressureProportioning' |
| 23436 | */ |
| 23437 | L4_MABX_B.Gain1_j = L4_MABX_P.Gain1_Gain_m * |
| 23438 | L4_MABX_P.BrkControl_RearAxlePressureProp; |
| 23439 | |
| 23440 | /* DataTypeConversion: '<S1031>/Data Type Conversion11' */ |
| 23441 | u0 = floor(L4_MABX_B.Gain1_j); |
| 23442 | if (rtIsNaN(u0) || rtIsInf(u0)) { |
| 23443 | u0 = 0.0; |
| 23444 | } else { |
| 23445 | u0 = fmod(u0, 256.0); |
| 23446 | } |
| 23447 | |
| 23448 | L4_MABX_B.DataTypeConversion11_b = (uint8_T)(u0 < 0.0 ? (int32_T)(uint8_T) |
| 23449 | -(int8_T)(uint8_T)-u0 : (int32_T)(uint8_T)u0); |
| 23450 | |
| 23451 | /* End of DataTypeConversion: '<S1031>/Data Type Conversion11' */ |
| 23452 | |
| 23453 | /* Reshape: '<S1034>/Reshape' incorporates: |
| 23454 | * Constant: '<S1034>/Constant' |
| 23455 | */ |
| 23456 | for (i = 0; i < 16; i++) { |
| 23457 | L4_MABX_B.Reshape_p[i] = L4_MABX_P.Repeating_Sequence_Stair_OutV_m[i]; |
| 23458 | } |
| 23459 | |
| 23460 | /* End of Reshape: '<S1034>/Reshape' */ |
| 23461 | |
| 23462 | /* UnitDelay: '<S1034>/Unit_Delay' */ |
| 23463 | L4_MABX_B.Unit_Delay_kx = L4_MABX_DW.Unit_Delay_DSTATE_nj; |
| 23464 | |
| 23465 | /* UnitDelay: '<S1035>/Unit Delay' */ |
| 23466 | L4_MABX_B.UnitDelay_n = L4_MABX_DW.UnitDelay_DSTATE_it; |
| 23467 | |
| 23468 | /* Switch: '<S1038>/Switch1' incorporates: |
| 23469 | * Constant: '<S1035>/E' |
| 23470 | * Constant: '<S1035>/IV' |
| 23471 | * Switch: '<S1037>/Switch1' |
| 23472 | */ |
| 23473 | if (L4_MABX_B.Unit_Delay_kx) { |
| 23474 | L4_MABX_B.Switch1_lw = L4_MABX_P.IV_Value_c; |
| 23475 | } else { |
| 23476 | if (L4_MABX_P.E_Value_cy) { |
| 23477 | /* Sum: '<S1035>/Subtract' incorporates: |
| 23478 | * Constant: '<S1035>/Constant' |
| 23479 | * Switch: '<S1037>/Switch1' |
| 23480 | */ |
| 23481 | q0 = L4_MABX_P.Constant_Value_dnj; |
| 23482 | qY = q0 + L4_MABX_B.UnitDelay_n; |
| 23483 | if (qY < q0) { |
| 23484 | qY = MAX_uint32_T; |
| 23485 | } |
| 23486 | |
| 23487 | L4_MABX_B.Subtract_jf = qY; |
| 23488 | |
| 23489 | /* End of Sum: '<S1035>/Subtract' */ |
| 23490 | |
| 23491 | /* Switch: '<S1037>/Switch1' */ |
| 23492 | L4_MABX_B.Switch1_fs = L4_MABX_B.Subtract_jf; |
| 23493 | } else { |
| 23494 | /* Switch: '<S1037>/Switch1' */ |
| 23495 | L4_MABX_B.Switch1_fs = L4_MABX_B.UnitDelay_n; |
| 23496 | } |
| 23497 | |
| 23498 | L4_MABX_B.Switch1_lw = L4_MABX_B.Switch1_fs; |
| 23499 | } |
| 23500 | |
| 23501 | /* End of Switch: '<S1038>/Switch1' */ |
| 23502 | |
| 23503 | /* Selector: '<S1034>/Selector' */ |
| 23504 | L4_MABX_B.Selector_c = L4_MABX_B.Reshape_p[(int32_T)L4_MABX_B.Switch1_lw - 1]; |
| 23505 | |
| 23506 | /* DataTypeConversion: '<S1031>/Data Type Conversion10' */ |
| 23507 | L4_MABX_B.DataTypeConversion10_h = L4_MABX_B.Selector_c; |
| 23508 | |
| 23509 | /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator6' */ |
| 23510 | L4_MABX_B.BitwiseOperator6 = (uint8_T)(L4_MABX_B.DataTypeConversion10_h & |
| 23511 | L4_MABX_P.BitwiseOperator6_BitMask); |
| 23512 | |
| 23513 | /* DataTypeConversion: '<S1030>/Data Type Conversion6' incorporates: |
| 23514 | * Constant: '<S1030>/Priority' |
| 23515 | */ |
| 23516 | L4_MABX_B.DataTypeConversion6_m = L4_MABX_P.Priority_Value_ce; |
| 23517 | |
| 23518 | /* ArithShift: '<S1030>/Shift_Arithmetic 5' */ |
| 23519 | L4_MABX_B.Shift_Arithmetic5 = L4_MABX_B.DataTypeConversion6_m << 26; |
| 23520 | |
| 23521 | /* DataTypeConversion: '<S1030>/Data Type Conversion7' incorporates: |
| 23522 | * Constant: '<S1030>/ExtendedDataPage' |
| 23523 | */ |
| 23524 | L4_MABX_B.DataTypeConversion7_g = L4_MABX_P.ExtendedDataPage_Value_n; |
| 23525 | |
| 23526 | /* ArithShift: '<S1030>/Shift_Arithmetic 6' */ |
| 23527 | L4_MABX_B.Shift_Arithmetic6 = L4_MABX_B.DataTypeConversion7_g << 25; |
| 23528 | |
| 23529 | /* DataTypeConversion: '<S1030>/Data Type Conversion8' incorporates: |
| 23530 | * Constant: '<S1030>/DataPage' |
| 23531 | */ |
| 23532 | L4_MABX_B.DataTypeConversion8_e = L4_MABX_P.DataPage_Value_l; |
| 23533 | |
| 23534 | /* ArithShift: '<S1030>/Shift_Arithmetic 7' */ |
| 23535 | L4_MABX_B.Shift_Arithmetic7 = L4_MABX_B.DataTypeConversion8_e << 24; |
| 23536 | |
| 23537 | /* DataTypeConversion: '<S1030>/Data Type Conversion9' incorporates: |
| 23538 | * Constant: '<S1030>/PDUFormat' |
| 23539 | */ |
| 23540 | L4_MABX_B.DataTypeConversion9_d = L4_MABX_P.PDUFormat_Value_b; |
| 23541 | |
| 23542 | /* ArithShift: '<S1030>/Shift_Arithmetic 8' */ |
| 23543 | L4_MABX_B.Shift_Arithmetic8 = L4_MABX_B.DataTypeConversion9_d << 16; |
| 23544 | |
| 23545 | /* DataTypeConversion: '<S1030>/Data Type Conversion10' incorporates: |
| 23546 | * Constant: '<S1030>/PDUSpecific' |
| 23547 | */ |
| 23548 | L4_MABX_B.DataTypeConversion10_n = L4_MABX_P.PDUSpecific_Value_f; |
| 23549 | |
| 23550 | /* ArithShift: '<S1030>/Shift_Arithmetic 9' */ |
| 23551 | L4_MABX_B.Shift_Arithmetic9 = L4_MABX_B.DataTypeConversion10_n << 8; |
| 23552 | |
| 23553 | /* DataTypeConversion: '<S1030>/Data Type Conversion11' incorporates: |
| 23554 | * Constant: '<S1030>/SourceAddress' |
| 23555 | */ |
| 23556 | L4_MABX_B.DataTypeConversion11_j = L4_MABX_P.SourceAddress_Value_n; |
| 23557 | |
| 23558 | /* S-Function (sfix_bitop): '<S1030>/Bitwise Operator17' */ |
| 23559 | L4_MABX_B.BitwiseOperator17 = L4_MABX_B.Shift_Arithmetic5 | |
| 23560 | L4_MABX_B.Shift_Arithmetic6 | L4_MABX_B.Shift_Arithmetic7 | |
| 23561 | L4_MABX_B.Shift_Arithmetic8 | L4_MABX_B.Shift_Arithmetic9 | |
| 23562 | L4_MABX_B.DataTypeConversion11_j; |
| 23563 | |
| 23564 | /* DataTypeConversion: '<S1031>/Data Type Conversion7' */ |
| 23565 | L4_MABX_B.DataTypeConversion7_m = L4_MABX_B.BitwiseOperator17; |
| 23566 | |
| 23567 | /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator2' */ |
| 23568 | L4_MABX_B.BitwiseOperator2 = L4_MABX_B.DataTypeConversion7_m & |
| 23569 | L4_MABX_P.BitwiseOperator2_BitMask; |
| 23570 | |
| 23571 | /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator3' */ |
| 23572 | L4_MABX_B.BitwiseOperator3 = L4_MABX_B.DataTypeConversion7_m & |
| 23573 | L4_MABX_P.BitwiseOperator3_BitMask; |
| 23574 | |
| 23575 | /* ArithShift: '<S1031>/Shift_Arithmetic 3' */ |
| 23576 | L4_MABX_B.Shift_Arithmetic3_n = L4_MABX_B.BitwiseOperator3 >> 8; |
| 23577 | |
| 23578 | /* DataTypeConversion: '<S1031>/Data Type Conversion5' */ |
| 23579 | L4_MABX_B.DataTypeConversion5_bz = (uint8_T)L4_MABX_B.Shift_Arithmetic3_n; |
| 23580 | |
| 23581 | /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator4' */ |
| 23582 | L4_MABX_B.BitwiseOperator4 = L4_MABX_B.DataTypeConversion7_m & |
| 23583 | L4_MABX_P.BitwiseOperator4_BitMask; |
| 23584 | |
| 23585 | /* ArithShift: '<S1031>/Shift_Arithmetic 4' */ |
| 23586 | L4_MABX_B.Shift_Arithmetic4_f = L4_MABX_B.BitwiseOperator4 >> 16; |
| 23587 | |
| 23588 | /* DataTypeConversion: '<S1031>/Data Type Conversion8' */ |
| 23589 | L4_MABX_B.DataTypeConversion8_dy = (uint8_T)L4_MABX_B.Shift_Arithmetic4_f; |
| 23590 | |
| 23591 | /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator5' */ |
| 23592 | L4_MABX_B.BitwiseOperator5 = L4_MABX_B.DataTypeConversion7_m & |
| 23593 | L4_MABX_P.BitwiseOperator5_BitMask; |
| 23594 | |
| 23595 | /* ArithShift: '<S1031>/Shift_Arithmetic 5' */ |
| 23596 | L4_MABX_B.Shift_Arithmetic5_a = L4_MABX_B.BitwiseOperator5 >> 24; |
| 23597 | |
| 23598 | /* DataTypeConversion: '<S1031>/Data Type Conversion9' */ |
| 23599 | L4_MABX_B.DataTypeConversion9_dy = (uint8_T)L4_MABX_B.Shift_Arithmetic5_a; |
| 23600 | |
| 23601 | /* Sum: '<S1031>/Add2' incorporates: |
| 23602 | * Constant: '<S1031>/Constant' |
| 23603 | * Constant: '<S1031>/Constant1' |
| 23604 | * Constant: '<S1031>/Constant3' |
| 23605 | * Constant: '<S1031>/Constant4' |
| 23606 | */ |
| 23607 | L4_MABX_B.Add2_d = (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T) |
| 23608 | (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T) |
| 23609 | ((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T) |
| 23610 | (uint8_T)((uint32_T)L4_MABX_B.DataTypeConversion2_oy + |
| 23611 | L4_MABX_B.BitwiseOperator17_g) + L4_MABX_B.DataTypeConversion11_b) |
| 23612 | + L4_MABX_P.Constant3_Value_ct) + L4_MABX_P.Constant4_Value_bl) + |
| 23613 | L4_MABX_P.Constant_Value_bn) + L4_MABX_P.Constant1_Value_odr) + (uint8_T) |
| 23614 | L4_MABX_B.BitwiseOperator2) + L4_MABX_B.DataTypeConversion5_bz) + |
| 23615 | L4_MABX_B.DataTypeConversion8_dy) + L4_MABX_B.DataTypeConversion9_dy) + |
| 23616 | L4_MABX_B.BitwiseOperator6); |
| 23617 | |
| 23618 | /* ArithShift: '<S1031>/Shift_Arithmetic 6' */ |
| 23619 | L4_MABX_B.Shift_Arithmetic6_c = (uint8_T)((uint32_T)L4_MABX_B.Add2_d >> 4); |
| 23620 | |
| 23621 | /* Sum: '<S1031>/Add3' */ |
| 23622 | L4_MABX_B.Add3_d = (uint8_T)((uint32_T)L4_MABX_B.Shift_Arithmetic6_c + |
| 23623 | L4_MABX_B.Add2_d); |
| 23624 | |
| 23625 | /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator8' */ |
| 23626 | L4_MABX_B.BitwiseOperator8 = (uint8_T)(L4_MABX_B.Add3_d & |
| 23627 | L4_MABX_P.BitwiseOperator8_BitMask); |
| 23628 | |
| 23629 | /* ArithShift: '<S1031>/Shift_Arithmetic 7' */ |
| 23630 | L4_MABX_B.Shift_Arithmetic7_h = (uint8_T)(L4_MABX_B.BitwiseOperator8 << 4); |
| 23631 | |
| 23632 | /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator7' */ |
| 23633 | L4_MABX_B.BitwiseOperator7 = (uint8_T)(L4_MABX_B.BitwiseOperator6 | |
| 23634 | L4_MABX_B.Shift_Arithmetic7_h); |
| 23635 | |
| 23636 | /* DataTypeConversion: '<S1012>/Data Type Conversion1' incorporates: |
| 23637 | * Constant: '<S1031>/Constant' |
| 23638 | * Constant: '<S1031>/Constant1' |
| 23639 | * Constant: '<S1031>/Constant3' |
| 23640 | * Constant: '<S1031>/Constant4' |
| 23641 | */ |
| 23642 | L4_MABX_B.DataTypeConversion1_de[0] = L4_MABX_B.DataTypeConversion2_oy; |
| 23643 | L4_MABX_B.DataTypeConversion1_de[1] = L4_MABX_B.BitwiseOperator17_g; |
| 23644 | L4_MABX_B.DataTypeConversion1_de[2] = L4_MABX_B.DataTypeConversion11_b; |
| 23645 | L4_MABX_B.DataTypeConversion1_de[3] = L4_MABX_P.Constant3_Value_ct; |
| 23646 | L4_MABX_B.DataTypeConversion1_de[4] = L4_MABX_P.Constant4_Value_bl; |
| 23647 | L4_MABX_B.DataTypeConversion1_de[5] = L4_MABX_P.Constant_Value_bn; |
| 23648 | L4_MABX_B.DataTypeConversion1_de[6] = L4_MABX_P.Constant1_Value_odr; |
| 23649 | L4_MABX_B.DataTypeConversion1_de[7] = L4_MABX_B.BitwiseOperator7; |
| 23650 | |
| 23651 | /* Outputs for Enabled SubSystem: '<S1020>/PropB_Bendix_2C2_XPR' incorporates: |
| 23652 | * EnablePort: '<S1021>/Enable' |
| 23653 | */ |
| 23654 | /* Constant: '<S1014>/CPV' */ |
| 23655 | if (L4_MABX_P.CPV_Value_f) { |
| 23656 | /* S-Function (rti_commonblock): '<S1021>/S-Function1' */ |
| 23657 | /* This comment workarounds a code generation problem */ |
| 23658 | |
| 23659 | /* dSPACE RTICAN TX Message Block: "PropB_Bendix_2C2_XPR" Id:218060389 */ |
| 23660 | { |
| 23661 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 23662 | |
| 23663 | Float32 delayTime = 0.0; |
| 23664 | |
| 23665 | /* ... Read status and timestamp info (previous message) */ |
| 23666 | can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]); |
| 23667 | |
| 23668 | /* Convert timestamp */ |
| 23669 | if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->processed) { |
| 23670 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->timestamp = |
| 23671 | rtk_dsts_time_to_simtime_convert |
| 23672 | (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->timestamp); |
| 23673 | } |
| 23674 | |
| 23675 | /* Messages with timestamp zero have been received in pause/stop state |
| 23676 | and must not be handled. |
| 23677 | */ |
| 23678 | if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->timestamp > 0.0) { |
| 23679 | L4_MABX_B.SFunction1_o1_bl = (real_T) |
| 23680 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->processed; |
| 23681 | L4_MABX_B.SFunction1_o2_f = (real_T) |
| 23682 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->timestamp; |
| 23683 | L4_MABX_B.SFunction1_o3_o = (real_T) |
| 23684 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->deltatime; |
| 23685 | L4_MABX_B.SFunction1_o4_o = (real_T) |
| 23686 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->delaytime; |
| 23687 | } |
| 23688 | |
| 23689 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 23690 | { |
| 23691 | rtican_Signal_t CAN_Sgn; |
| 23692 | |
| 23693 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 23694 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23695 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_de[0] ) |
| 23696 | + 0.5); |
| 23697 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 23698 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 23699 | |
| 23700 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 23701 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23702 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_de[1] ) |
| 23703 | + 0.5); |
| 23704 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 23705 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 23706 | |
| 23707 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 23708 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23709 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_de[2] ) |
| 23710 | + 0.5); |
| 23711 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 23712 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 23713 | |
| 23714 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 23715 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23716 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_de[3] ) |
| 23717 | + 0.5); |
| 23718 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 23719 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 23720 | |
| 23721 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 23722 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23723 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_de[4] ) |
| 23724 | + 0.5); |
| 23725 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 23726 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 23727 | |
| 23728 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 23729 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23730 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_de[5] ) |
| 23731 | + 0.5); |
| 23732 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 23733 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 23734 | |
| 23735 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 23736 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23737 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_de[6] ) |
| 23738 | + 0.5); |
| 23739 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 23740 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 23741 | |
| 23742 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 23743 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23744 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_de[7] ) |
| 23745 | + 0.5); |
| 23746 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 23747 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 23748 | } |
| 23749 | |
| 23750 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 23751 | can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665], 8, |
| 23752 | &(CAN_Msg[0]), delayTime); |
| 23753 | } |
| 23754 | } |
| 23755 | |
| 23756 | /* End of Constant: '<S1014>/CPV' */ |
| 23757 | /* End of Outputs for SubSystem: '<S1020>/PropB_Bendix_2C2_XPR' */ |
| 23758 | |
| 23759 | /* DataTypeConversion: '<S1028>/Data Type Conversion' */ |
| 23760 | L4_MABX_B.DataTypeConversion_pw = L4_MABX_B.FrontAxleSpeed_g; |
| 23761 | |
| 23762 | /* DataTypeConversion: '<S1028>/Data Type Conversion1' */ |
| 23763 | L4_MABX_B.DataTypeConversion1_l = L4_MABX_B.SPN1807_SteeringWheelAngle_j; |
| 23764 | |
| 23765 | /* DataTypeConversion: '<S1028>/Data Type Conversion2' */ |
| 23766 | L4_MABX_B.DataTypeConversion2_po = L4_MABX_B.SPN1808_YawRate_o; |
| 23767 | |
| 23768 | /* DataTypeConversion: '<S1028>/Data Type Conversion3' */ |
| 23769 | L4_MABX_B.DataTypeConversion3_c = L4_MABX_B.SPN1810_LongitudinalAccelerat_i; |
| 23770 | |
| 23771 | /* DataTypeConversion: '<S1013>/Data Type Conversion' incorporates: |
| 23772 | * Constant: '<S855>/CANT_STD_ODOMETRY_CHANNEL_APV' |
| 23773 | */ |
| 23774 | L4_MABX_B.DataTypeConversion_cv = (uint8_T) |
| 23775 | L4_MABX_P.CANT_STD_ODOMETRY_CHANNEL_APV_V; |
| 23776 | |
| 23777 | /* S-Function (sfix_bitop): '<S1027>/Operator' */ |
| 23778 | L4_MABX_B.Operator_l3 = (uint8_T)(L4_MABX_B.DataTypeConversion_cv & |
| 23779 | L4_MABX_P.Operator_BitMask_km); |
| 23780 | |
| 23781 | /* DataTypeConversion: '<S1027>/DataType' */ |
| 23782 | L4_MABX_B.DataType = L4_MABX_B.Operator_l3; |
| 23783 | |
| 23784 | /* ArithShift: '<S1013>/Shift_Arithmetic 4' */ |
| 23785 | L4_MABX_B.Shift_Arithmetic4 = ldexp(L4_MABX_B.DataType, (-5)); |
| 23786 | |
| 23787 | /* DataTypeConversion: '<S1013>/Data Type Conversion7' */ |
| 23788 | L4_MABX_B.DataTypeConversion7_n1 = (L4_MABX_B.Shift_Arithmetic4 != 0.0); |
| 23789 | |
| 23790 | /* Outputs for Enabled SubSystem: '<S1028>/Std_OdometryData' incorporates: |
| 23791 | * EnablePort: '<S1029>/Enable' |
| 23792 | */ |
| 23793 | if (L4_MABX_B.DataTypeConversion7_n1) { |
| 23794 | /* S-Function (rti_commonblock): '<S1029>/S-Function1' */ |
| 23795 | /* This comment workarounds a code generation problem */ |
| 23796 | |
| 23797 | /* dSPACE RTICAN TX Message Block: "Std_OdometryData" Id:10 */ |
| 23798 | { |
| 23799 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 23800 | |
| 23801 | Float32 delayTime = 0.0; |
| 23802 | |
| 23803 | /* ... Read status and timestamp info (previous message) */ |
| 23804 | can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]); |
| 23805 | |
| 23806 | /* Convert timestamp */ |
| 23807 | if (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->processed) { |
| 23808 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->timestamp = |
| 23809 | rtk_dsts_time_to_simtime_convert |
| 23810 | (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->timestamp); |
| 23811 | } |
| 23812 | |
| 23813 | /* Messages with timestamp zero have been received in pause/stop state |
| 23814 | and must not be handled. |
| 23815 | */ |
| 23816 | if (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->timestamp > 0.0) { |
| 23817 | L4_MABX_B.SFunction1_o1_nh = (real_T) |
| 23818 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->processed; |
| 23819 | L4_MABX_B.SFunction1_o2_hj = (real_T) |
| 23820 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->timestamp; |
| 23821 | L4_MABX_B.SFunction1_o3_m = (real_T) |
| 23822 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->deltatime; |
| 23823 | L4_MABX_B.SFunction1_o4_f = (real_T) |
| 23824 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->delaytime; |
| 23825 | } |
| 23826 | |
| 23827 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 23828 | { |
| 23829 | rtican_Signal_t CAN_Sgn; |
| 23830 | |
| 23831 | /* ...... "SPN904_FrontAxleSpeed" (0|16, standard signal, unsigned int, little endian) */ |
| 23832 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23833 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_pw - ( 0 ) |
| 23834 | ) / 0.00390625 + 0.5); |
| 23835 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 23836 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 23837 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte1; |
| 23838 | |
| 23839 | /* ...... "SPN1807_SteeringWheelAngle" (16|16, standard signal, unsigned int, little endian) */ |
| 23840 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23841 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_l - |
| 23842 | ( -31.374 ) ) / 0.0009765625 + 0.5); |
| 23843 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 23844 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 23845 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte1; |
| 23846 | |
| 23847 | /* ...... "SPN1808_YawRate" (32|16, standard signal, unsigned int, little endian) */ |
| 23848 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23849 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion2_po - |
| 23850 | ( -3.92 ) ) / 0.0001220703125 + 0.5); |
| 23851 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 23852 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 23853 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte1; |
| 23854 | |
| 23855 | /* ...... "SPN1810_LongitudinalAcceleration" (48|8, standard signal, unsigned int, little endian) */ |
| 23856 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 23857 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion3_c - |
| 23858 | ( -12.5 ) ) / 0.1 + 0.5); |
| 23859 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 23860 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 23861 | } |
| 23862 | |
| 23863 | /* mask unused bits with '1' */ |
| 23864 | CAN_Msg[7] |= 0xFF; |
| 23865 | |
| 23866 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 23867 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA], 8, &(CAN_Msg[0]), |
| 23868 | delayTime); |
| 23869 | } |
| 23870 | } |
| 23871 | |
| 23872 | /* End of Outputs for SubSystem: '<S1028>/Std_OdometryData' */ |
| 23873 | |
| 23874 | /* S-Function (sfix_bitop): '<S1022>/Operator' */ |
| 23875 | L4_MABX_B.Operator_kx = (uint8_T)(L4_MABX_B.DataTypeConversion_cv & |
| 23876 | L4_MABX_P.Operator_BitMask_dou); |
| 23877 | |
| 23878 | /* DataTypeConversion: '<S1022>/DataType' */ |
| 23879 | L4_MABX_B.DataType_cd = L4_MABX_B.Operator_kx; |
| 23880 | |
| 23881 | /* S-Function (sfix_bitop): '<S1023>/Operator' */ |
| 23882 | L4_MABX_B.Operator_d2 = (uint8_T)(L4_MABX_B.DataTypeConversion_cv & |
| 23883 | L4_MABX_P.Operator_BitMask_hy); |
| 23884 | |
| 23885 | /* DataTypeConversion: '<S1023>/DataType' */ |
| 23886 | L4_MABX_B.DataType_o = L4_MABX_B.Operator_d2; |
| 23887 | |
| 23888 | /* S-Function (sfix_bitop): '<S1024>/Operator' */ |
| 23889 | L4_MABX_B.Operator_he = (uint8_T)(L4_MABX_B.DataTypeConversion_cv & |
| 23890 | L4_MABX_P.Operator_BitMask_nqc); |
| 23891 | |
| 23892 | /* DataTypeConversion: '<S1024>/DataType' */ |
| 23893 | L4_MABX_B.DataType_d = L4_MABX_B.Operator_he; |
| 23894 | |
| 23895 | /* S-Function (sfix_bitop): '<S1025>/Operator' */ |
| 23896 | L4_MABX_B.Operator_fx = (uint8_T)(L4_MABX_B.DataTypeConversion_cv & |
| 23897 | L4_MABX_P.Operator_BitMask_ne); |
| 23898 | |
| 23899 | /* DataTypeConversion: '<S1025>/DataType' */ |
| 23900 | L4_MABX_B.DataType_k = L4_MABX_B.Operator_fx; |
| 23901 | |
| 23902 | /* S-Function (sfix_bitop): '<S1026>/Operator' */ |
| 23903 | L4_MABX_B.Operator_j = (uint8_T)(L4_MABX_B.DataTypeConversion_cv & |
| 23904 | L4_MABX_P.Operator_BitMask_gl); |
| 23905 | |
| 23906 | /* DataTypeConversion: '<S1026>/DataType' */ |
| 23907 | L4_MABX_B.DataType_m = L4_MABX_B.Operator_j; |
| 23908 | |
| 23909 | /* DataTypeConversion: '<S1013>/Data Type Conversion2' */ |
| 23910 | L4_MABX_B.DataTypeConversion2_g = (L4_MABX_B.DataType_cd != 0); |
| 23911 | |
| 23912 | /* ArithShift: '<S1013>/Shift_Arithmetic ' */ |
| 23913 | L4_MABX_B.Shift_Arithmetic = ldexp(L4_MABX_B.DataType_o, (-1)); |
| 23914 | |
| 23915 | /* DataTypeConversion: '<S1013>/Data Type Conversion3' */ |
| 23916 | L4_MABX_B.DataTypeConversion3_k3 = (L4_MABX_B.Shift_Arithmetic != 0.0); |
| 23917 | |
| 23918 | /* ArithShift: '<S1013>/Shift_Arithmetic 1' */ |
| 23919 | L4_MABX_B.Shift_Arithmetic1 = ldexp(L4_MABX_B.DataType_d, (-2)); |
| 23920 | |
| 23921 | /* DataTypeConversion: '<S1013>/Data Type Conversion4' */ |
| 23922 | L4_MABX_B.DataTypeConversion4_bb = (L4_MABX_B.Shift_Arithmetic1 != 0.0); |
| 23923 | |
| 23924 | /* ArithShift: '<S1013>/Shift_Arithmetic 2' */ |
| 23925 | L4_MABX_B.Shift_Arithmetic2 = ldexp(L4_MABX_B.DataType_k, (-3)); |
| 23926 | |
| 23927 | /* DataTypeConversion: '<S1013>/Data Type Conversion5' */ |
| 23928 | L4_MABX_B.DataTypeConversion5_if = (L4_MABX_B.Shift_Arithmetic2 != 0.0); |
| 23929 | |
| 23930 | /* ArithShift: '<S1013>/Shift_Arithmetic 3' */ |
| 23931 | L4_MABX_B.Shift_Arithmetic3 = ldexp(L4_MABX_B.DataType_m, (-4)); |
| 23932 | |
| 23933 | /* DataTypeConversion: '<S1013>/Data Type Conversion6' */ |
| 23934 | L4_MABX_B.DataTypeConversion6_h = (L4_MABX_B.Shift_Arithmetic3 != 0.0); |
| 23935 | |
| 23936 | /* RelationalOperator: '<S1036>/Operator' */ |
| 23937 | L4_MABX_B.Operator_f4 = (L4_MABX_B.Switch1_lw == L4_MABX_B.Width_e); |
| 23938 | |
| 23939 | /* Lookup_n-D: '<S1015>/DECEL_GOV_XBR_URGENCY_MPV' */ |
| 23940 | L4_MABX_B.XBRUrgency = look1_binlcapw(L4_MABX_B.XBRExternalAccelDemand, |
| 23941 | L4_MABX_P.DECEL_GOV_XBR_URGENCY_MPV_bp01D, |
| 23942 | L4_MABX_P.DECEL_GOV_XBR_URGENCY_MPV_table, 7U); |
| 23943 | |
| 23944 | /* End of Outputs for SubSystem: '<S849>/CAN_TX_20ms' */ |
| 23945 | |
| 23946 | /* Outputs for Atomic SubSystem: '<S65>/Task_20ms' */ |
| 23947 | /* RelationalOperator: '<S395>/CheckHDOP' incorporates: |
| 23948 | * Constant: '<S395>/MaximumGoodHDOP' |
| 23949 | */ |
| 23950 | L4_MABX_B.CheckHDOP = (L4_MABX_B.HDOP__f <= L4_MABX_P.MaximumGoodHDOP_Value); |
| 23951 | |
| 23952 | /* Gain: '<S395>/kph2mps' */ |
| 23953 | L4_MABX_B.kph2mps = L4_MABX_P.kph2mps_Gain_l * L4_MABX_B.FrontAxleSpeed_d; |
| 23954 | |
| 23955 | /* Product: '<S395>/Product' incorporates: |
| 23956 | * Constant: '<S395>/lookAheadTime' |
| 23957 | */ |
| 23958 | L4_MABX_B.Product_c = L4_MABX_B.kph2mps * L4_MABX_P.lookAheadTime_Value; |
| 23959 | |
| 23960 | /* Gain: '<S395>/kph2mps1' */ |
| 23961 | L4_MABX_B.kph2mps1 = L4_MABX_P.kph2mps1_Gain * L4_MABX_B.FrontAxleSpeed_dv; |
| 23962 | |
| 23963 | /* Product: '<S395>/Product1' incorporates: |
| 23964 | * Constant: '<S395>/lookAheadTime1' |
| 23965 | */ |
| 23966 | L4_MABX_B.Product1_hl = L4_MABX_B.kph2mps1 * L4_MABX_P.lookAheadTime1_Value; |
| 23967 | |
| 23968 | /* UnitDelay: '<S395>/Unit Delay1' */ |
| 23969 | L4_MABX_B.UnitDelay1 = L4_MABX_DW.UnitDelay1_DSTATE; |
| 23970 | |
| 23971 | /* Constant: '<S396>/InitialHeading' */ |
| 23972 | L4_MABX_B.InitialHeading = L4_MABX_P.InitialHeading_Value; |
| 23973 | |
| 23974 | /* Constant: '<S396>/InitialPosition' */ |
| 23975 | L4_MABX_B.InitialPosition = L4_MABX_P.InitialPosition_Value; |
| 23976 | |
| 23977 | /* Constant: '<S396>/InitialXPosition' */ |
| 23978 | L4_MABX_B.InitialXPosition = L4_MABX_P.InitialXPosition_Value; |
| 23979 | |
| 23980 | /* Constant: '<S396>/InitialYPosition' */ |
| 23981 | L4_MABX_B.InitialYPosition = L4_MABX_P.InitialYPosition_Value; |
| 23982 | |
| 23983 | /* Gain: '<S71>/kph2ms' */ |
| 23984 | L4_MABX_B.kph2ms = L4_MABX_P.kph2ms_Gain * L4_MABX_B.FrontAxleSpeed_dvq; |
| 23985 | |
| 23986 | /* DiscreteIntegrator: '<S396>/LongitudnalPosition' incorporates: |
| 23987 | * Constant: '<S395>/Constant' |
| 23988 | */ |
| 23989 | if ((L4_MABX_P.Constant_Value_p > 0.0) && |
| 23990 | (L4_MABX_DW.LongitudnalPosition_PrevResetSt <= 0)) { |
| 23991 | L4_MABX_DW.LongitudnalPosition_DSTATE = L4_MABX_B.InitialPosition; |
| 23992 | } |
| 23993 | |
| 23994 | L4_MABX_B.LongitudnalPosition = L4_MABX_P.LongitudnalPosition_gainval * |
| 23995 | L4_MABX_B.kph2ms + L4_MABX_DW.LongitudnalPosition_DSTATE; |
| 23996 | |
| 23997 | /* End of DiscreteIntegrator: '<S396>/LongitudnalPosition' */ |
| 23998 | |
| 23999 | /* Trigonometry: '<S396>/Trigonometric Function' */ |
| 24000 | L4_MABX_B.TrigonometricFunction = sin(L4_MABX_B.kph2ms); |
| 24001 | |
| 24002 | /* Trigonometry: '<S396>/Trigonometric Function1' */ |
| 24003 | L4_MABX_B.TrigonometricFunction1 = cos(L4_MABX_B.kph2ms); |
| 24004 | |
| 24005 | /* DiscreteIntegrator: '<S396>/VehHeading' incorporates: |
| 24006 | * Constant: '<S396>/reset' |
| 24007 | */ |
| 24008 | if ((L4_MABX_P.reset_Value > 0.0) && (L4_MABX_DW.VehHeading_PrevResetState <= |
| 24009 | 0)) { |
| 24010 | L4_MABX_DW.VehHeading_DSTATE = L4_MABX_B.InitialHeading; |
| 24011 | } |
| 24012 | |
| 24013 | L4_MABX_B.VehHeading = L4_MABX_P.VehHeading_gainval * |
| 24014 | L4_MABX_B.TmpRTBAtVehHeadingInport1 + L4_MABX_DW.VehHeading_DSTATE; |
| 24015 | |
| 24016 | /* End of DiscreteIntegrator: '<S396>/VehHeading' */ |
| 24017 | |
| 24018 | /* DiscreteIntegrator: '<S396>/XPosition' incorporates: |
| 24019 | * Constant: '<S396>/reset' |
| 24020 | */ |
| 24021 | if ((L4_MABX_P.reset_Value > 0.0) && (L4_MABX_DW.XPosition_PrevResetState <= 0)) |
| 24022 | { |
| 24023 | L4_MABX_DW.XPosition_DSTATE = L4_MABX_B.InitialXPosition; |
| 24024 | } |
| 24025 | |
| 24026 | L4_MABX_B.XPosition = L4_MABX_P.XPosition_gainval * |
| 24027 | L4_MABX_B.TrigonometricFunction1 + L4_MABX_DW.XPosition_DSTATE; |
| 24028 | |
| 24029 | /* End of DiscreteIntegrator: '<S396>/XPosition' */ |
| 24030 | |
| 24031 | /* DiscreteIntegrator: '<S396>/YPosition' incorporates: |
| 24032 | * Constant: '<S396>/reset' |
| 24033 | */ |
| 24034 | if ((L4_MABX_P.reset_Value > 0.0) && (L4_MABX_DW.YPosition_PrevResetState <= 0)) |
| 24035 | { |
| 24036 | L4_MABX_DW.YPosition_DSTATE = L4_MABX_B.InitialYPosition; |
| 24037 | } |
| 24038 | |
| 24039 | L4_MABX_B.YPosition = L4_MABX_P.YPosition_gainval * |
| 24040 | L4_MABX_B.TrigonometricFunction + L4_MABX_DW.YPosition_DSTATE; |
| 24041 | |
| 24042 | /* End of DiscreteIntegrator: '<S396>/YPosition' */ |
| 24043 | /* End of Outputs for SubSystem: '<S65>/Task_20ms' */ |
| 24044 | |
| 24045 | /* UnitDelay: '<S3>/Unit_Delay' */ |
| 24046 | L4_MABX_B.S = L4_MABX_DW.Unit_Delay_49_DSTATE; |
| 24047 | L4_MABX_B.B = L4_MABX_DW.Unit_Delay_50_DSTATE; |
| 24048 | L4_MABX_B.X = L4_MABX_DW.Unit_Delay_51_DSTATE; |
| 24049 | L4_MABX_B.Y = L4_MABX_DW.Unit_Delay_52_DSTATE; |
| 24050 | L4_MABX_B.pathCurveOffset = L4_MABX_DW.Unit_Delay_53_DSTATE; |
| 24051 | L4_MABX_B.S_b = L4_MABX_DW.Unit_Delay_54_DSTATE; |
| 24052 | L4_MABX_B.distanceSpdTarget = L4_MABX_DW.Unit_Delay_55_DSTATE; |
| 24053 | L4_MABX_B.state = L4_MABX_DW.Unit_Delay_56_DSTATE; |
| 24054 | L4_MABX_B.lastWayPointIdx = L4_MABX_DW.Unit_Delay_57_DSTATE; |
| 24055 | L4_MABX_B.crossed = L4_MABX_DW.Unit_Delay_58_DSTATE; |
| 24056 | L4_MABX_B.minimumDist = L4_MABX_DW.Unit_Delay_59_DSTATE; |
| 24057 | L4_MABX_B.SrefOnthisPath = L4_MABX_DW.Unit_Delay_60_DSTATE; |
| 24058 | L4_MABX_B.StartDist = L4_MABX_DW.Unit_Delay_61_DSTATE; |
| 24059 | L4_MABX_B.minDistIdx = L4_MABX_DW.Unit_Delay_62_DSTATE; |
| 24060 | L4_MABX_B.pathS = L4_MABX_DW.Unit_Delay_63_DSTATE; |
| 24061 | L4_MABX_B.pathLat = L4_MABX_DW.Unit_Delay_64_DSTATE; |
| 24062 | L4_MABX_B.pathLong = L4_MABX_DW.Unit_Delay_65_DSTATE; |
| 24063 | L4_MABX_B.pathSteeringAngle = L4_MABX_DW.Unit_Delay_66_DSTATE; |
| 24064 | L4_MABX_B.pathSpdLimit = L4_MABX_DW.Unit_Delay_67_DSTATE; |
| 24065 | L4_MABX_B.distance = L4_MABX_DW.Unit_Delay_68_DSTATE; |
| 24066 | L4_MABX_B.idx = L4_MABX_DW.Unit_Delay_69_DSTATE; |
| 24067 | L4_MABX_B.wpidx = L4_MABX_DW.Unit_Delay_70_DSTATE; |
| 24068 | L4_MABX_B.pathOffset = L4_MABX_DW.Unit_Delay_71_DSTATE; |
| 24069 | L4_MABX_B.sRefDistance = L4_MABX_DW.Unit_Delay_72_DSTATE; |
| 24070 | L4_MABX_B.refDistance = L4_MABX_DW.Unit_Delay_73_DSTATE; |
| 24071 | L4_MABX_B.wpIdx = L4_MABX_DW.Unit_Delay_74_DSTATE; |
| 24072 | L4_MABX_B.previewSteeringAngle_l = L4_MABX_DW.Unit_Delay_75_DSTATE; |
| 24073 | L4_MABX_B.desHeading = L4_MABX_DW.Unit_Delay_76_DSTATE; |
| 24074 | L4_MABX_B.actPreviewDist = L4_MABX_DW.Unit_Delay_77_DSTATE; |
| 24075 | L4_MABX_B.desPreviewDist = L4_MABX_DW.Unit_Delay_78_DSTATE; |
| 24076 | L4_MABX_B.mappingSearchCase = L4_MABX_DW.Unit_Delay_79_DSTATE; |
| 24077 | |
| 24078 | /* user code (Output function Trailer for TID1) */ |
| 24079 | |
| 24080 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 24081 | /* EventChannel: 0 */ |
| 24082 | if (tid == 0) { |
| 24083 | DSXCP_service(0); |
| 24084 | } |
| 24085 | |
| 24086 | /* If subsystem generates rate grouping Output functions, |
| 24087 | * when tid is used in Output function for one rate, |
| 24088 | * all Output functions include tid as a local variable. |
| 24089 | * As result, some Output functions may have unused tid. |
| 24090 | */ |
| 24091 | UNUSED_PARAMETER(tid); |
| 24092 | } |
| 24093 | |
| 24094 | /* Model update function for TID1 */ |
| 24095 | void L4_MABX_update1(void) /* Sample time: [0.02s, 0.0s] */ |
| 24096 | { |
| 24097 | /* Update for Atomic SubSystem: '<S65>/Task_10ms' */ |
| 24098 | /* Update for RateTransition: '<S81>/TmpRTBAtSignal Conversion1Inport1' incorporates: |
| 24099 | * Constant: '<S395>/Constant2' |
| 24100 | */ |
| 24101 | L4_MABX_DW.TmpRTBAtSignalConversion1Inport = L4_MABX_P.Constant2_Value_a; |
| 24102 | |
| 24103 | /* Update for RateTransition: '<S81>/TmpRTBAtSignal Conversion3Inport1' incorporates: |
| 24104 | * Constant: '<S395>/Constant13' |
| 24105 | */ |
| 24106 | L4_MABX_DW.TmpRTBAtSignalConversion3Inport = L4_MABX_P.Constant13_Value; |
| 24107 | |
| 24108 | /* Update for RateTransition: '<S81>/TmpRTBAtSignal Conversion2Inport1' incorporates: |
| 24109 | * Constant: '<S395>/Constant14' |
| 24110 | */ |
| 24111 | L4_MABX_DW.TmpRTBAtSignalConversion2Inport = L4_MABX_P.Constant14_Value; |
| 24112 | |
| 24113 | /* Update for RateTransition: '<S80>/TmpRTBAtrad2deg1Inport1' incorporates: |
| 24114 | * Constant: '<S395>/Constant17' |
| 24115 | */ |
| 24116 | L4_MABX_DW.TmpRTBAtrad2deg1Inport1_Buffer0 = L4_MABX_P.Constant17_Value; |
| 24117 | |
| 24118 | /* Update for RateTransition: '<S80>/TmpRTBAtsignCurveOffsetInport1' incorporates: |
| 24119 | * Constant: '<S395>/Constant1' |
| 24120 | */ |
| 24121 | L4_MABX_DW.TmpRTBAtsignCurveOffsetInport1_ = L4_MABX_P.Constant1_Value_g; |
| 24122 | |
| 24123 | /* Update for RateTransition: '<S284>/TmpRTBAtAdd2Inport2' incorporates: |
| 24124 | * Constant: '<S395>/Constant18' |
| 24125 | */ |
| 24126 | L4_MABX_DW.TmpRTBAtAdd2Inport2_Buffer0 = L4_MABX_P.Constant18_Value; |
| 24127 | |
| 24128 | /* End of Update for SubSystem: '<S65>/Task_10ms' */ |
| 24129 | |
| 24130 | /* Update for Atomic SubSystem: '<S849>/CAN_TX_20ms' */ |
| 24131 | |
| 24132 | /* Update for UnitDelay: '<S1011>/Unit_Delay' */ |
| 24133 | L4_MABX_DW.Unit_Delay_DSTATE_id = L4_MABX_B.TmpRTBAtUnit_DelayInport1; |
| 24134 | |
| 24135 | /* Update for UnitDelay: '<S1034>/Unit_Delay' */ |
| 24136 | L4_MABX_DW.Unit_Delay_DSTATE_nj = L4_MABX_B.Operator_f4; |
| 24137 | |
| 24138 | /* Update for UnitDelay: '<S1035>/Unit Delay' */ |
| 24139 | L4_MABX_DW.UnitDelay_DSTATE_it = L4_MABX_B.Switch1_lw; |
| 24140 | |
| 24141 | /* End of Update for SubSystem: '<S849>/CAN_TX_20ms' */ |
| 24142 | |
| 24143 | /* Update for Atomic SubSystem: '<S65>/Task_20ms' */ |
| 24144 | /* Update for UnitDelay: '<S395>/Unit Delay1' */ |
| 24145 | L4_MABX_DW.UnitDelay1_DSTATE = L4_MABX_B.LongitudnalPosition; |
| 24146 | |
| 24147 | /* Update for DiscreteIntegrator: '<S396>/LongitudnalPosition' incorporates: |
| 24148 | * Constant: '<S395>/Constant' |
| 24149 | */ |
| 24150 | L4_MABX_DW.LongitudnalPosition_DSTATE = L4_MABX_P.LongitudnalPosition_gainval * |
| 24151 | L4_MABX_B.kph2ms + L4_MABX_B.LongitudnalPosition; |
| 24152 | if (L4_MABX_P.Constant_Value_p > 0.0) { |
| 24153 | L4_MABX_DW.LongitudnalPosition_PrevResetSt = 1; |
| 24154 | } else if (L4_MABX_P.Constant_Value_p < 0.0) { |
| 24155 | L4_MABX_DW.LongitudnalPosition_PrevResetSt = -1; |
| 24156 | } else if (L4_MABX_P.Constant_Value_p == 0.0) { |
| 24157 | L4_MABX_DW.LongitudnalPosition_PrevResetSt = 0; |
| 24158 | } else { |
| 24159 | L4_MABX_DW.LongitudnalPosition_PrevResetSt = 2; |
| 24160 | } |
| 24161 | |
| 24162 | /* End of Update for DiscreteIntegrator: '<S396>/LongitudnalPosition' */ |
| 24163 | |
| 24164 | /* Update for DiscreteIntegrator: '<S396>/VehHeading' incorporates: |
| 24165 | * Constant: '<S396>/reset' |
| 24166 | * DiscreteIntegrator: '<S396>/XPosition' |
| 24167 | */ |
| 24168 | L4_MABX_DW.VehHeading_DSTATE = L4_MABX_P.VehHeading_gainval * |
| 24169 | L4_MABX_B.TmpRTBAtVehHeadingInport1 + L4_MABX_B.VehHeading; |
| 24170 | if (L4_MABX_P.reset_Value > 0.0) { |
| 24171 | L4_MABX_DW.VehHeading_PrevResetState = 1; |
| 24172 | L4_MABX_DW.XPosition_PrevResetState = 1; |
| 24173 | } else { |
| 24174 | if (L4_MABX_P.reset_Value < 0.0) { |
| 24175 | L4_MABX_DW.VehHeading_PrevResetState = -1; |
| 24176 | } else if (L4_MABX_P.reset_Value == 0.0) { |
| 24177 | L4_MABX_DW.VehHeading_PrevResetState = 0; |
| 24178 | } else { |
| 24179 | L4_MABX_DW.VehHeading_PrevResetState = 2; |
| 24180 | } |
| 24181 | |
| 24182 | if (L4_MABX_P.reset_Value < 0.0) { |
| 24183 | L4_MABX_DW.XPosition_PrevResetState = -1; |
| 24184 | } else if (L4_MABX_P.reset_Value == 0.0) { |
| 24185 | L4_MABX_DW.XPosition_PrevResetState = 0; |
| 24186 | } else { |
| 24187 | L4_MABX_DW.XPosition_PrevResetState = 2; |
| 24188 | } |
| 24189 | } |
| 24190 | |
| 24191 | /* End of Update for DiscreteIntegrator: '<S396>/VehHeading' */ |
| 24192 | |
| 24193 | /* Update for DiscreteIntegrator: '<S396>/XPosition' */ |
| 24194 | L4_MABX_DW.XPosition_DSTATE = L4_MABX_P.XPosition_gainval * |
| 24195 | L4_MABX_B.TrigonometricFunction1 + L4_MABX_B.XPosition; |
| 24196 | |
| 24197 | /* Update for DiscreteIntegrator: '<S396>/YPosition' incorporates: |
| 24198 | * Constant: '<S396>/reset' |
| 24199 | */ |
| 24200 | L4_MABX_DW.YPosition_DSTATE = L4_MABX_P.YPosition_gainval * |
| 24201 | L4_MABX_B.TrigonometricFunction + L4_MABX_B.YPosition; |
| 24202 | if (L4_MABX_P.reset_Value > 0.0) { |
| 24203 | L4_MABX_DW.YPosition_PrevResetState = 1; |
| 24204 | } else if (L4_MABX_P.reset_Value < 0.0) { |
| 24205 | L4_MABX_DW.YPosition_PrevResetState = -1; |
| 24206 | } else if (L4_MABX_P.reset_Value == 0.0) { |
| 24207 | L4_MABX_DW.YPosition_PrevResetState = 0; |
| 24208 | } else { |
| 24209 | L4_MABX_DW.YPosition_PrevResetState = 2; |
| 24210 | } |
| 24211 | |
| 24212 | /* End of Update for DiscreteIntegrator: '<S396>/YPosition' */ |
| 24213 | /* End of Update for SubSystem: '<S65>/Task_20ms' */ |
| 24214 | |
| 24215 | /* Update for UnitDelay: '<S3>/Unit_Delay' incorporates: |
| 24216 | * Constant: '<S395>/Constant1' |
| 24217 | * Constant: '<S395>/Constant10' |
| 24218 | * Constant: '<S395>/Constant11' |
| 24219 | * Constant: '<S395>/Constant12' |
| 24220 | * Constant: '<S395>/Constant13' |
| 24221 | * Constant: '<S395>/Constant14' |
| 24222 | * Constant: '<S395>/Constant15' |
| 24223 | * Constant: '<S395>/Constant16' |
| 24224 | * Constant: '<S395>/Constant17' |
| 24225 | * Constant: '<S395>/Constant18' |
| 24226 | * Constant: '<S395>/Constant19' |
| 24227 | * Constant: '<S395>/Constant2' |
| 24228 | * Constant: '<S395>/Constant20' |
| 24229 | * Constant: '<S395>/Constant21' |
| 24230 | * Constant: '<S395>/Constant22' |
| 24231 | * Constant: '<S395>/Constant23' |
| 24232 | * Constant: '<S395>/Constant24' |
| 24233 | * Constant: '<S395>/Constant25' |
| 24234 | * Constant: '<S395>/Constant3' |
| 24235 | * Constant: '<S395>/Constant4' |
| 24236 | * Constant: '<S395>/Constant5' |
| 24237 | * Constant: '<S395>/Constant6' |
| 24238 | * Constant: '<S395>/Constant7' |
| 24239 | * Constant: '<S395>/Constant8' |
| 24240 | * Constant: '<S395>/Constant9' |
| 24241 | */ |
| 24242 | L4_MABX_DW.Unit_Delay_49_DSTATE = L4_MABX_B.LongitudnalPosition; |
| 24243 | L4_MABX_DW.Unit_Delay_50_DSTATE = L4_MABX_B.VehHeading; |
| 24244 | L4_MABX_DW.Unit_Delay_51_DSTATE = L4_MABX_B.XPosition; |
| 24245 | L4_MABX_DW.Unit_Delay_52_DSTATE = L4_MABX_B.YPosition; |
| 24246 | L4_MABX_DW.Unit_Delay_53_DSTATE = L4_MABX_P.Constant1_Value_g; |
| 24247 | L4_MABX_DW.Unit_Delay_54_DSTATE = L4_MABX_B.UnitDelay1; |
| 24248 | L4_MABX_DW.Unit_Delay_55_DSTATE = L4_MABX_P.Constant2_Value_a; |
| 24249 | L4_MABX_DW.Unit_Delay_56_DSTATE = L4_MABX_P.Constant3_Value_l; |
| 24250 | L4_MABX_DW.Unit_Delay_57_DSTATE = L4_MABX_P.Constant4_Value_m; |
| 24251 | L4_MABX_DW.Unit_Delay_58_DSTATE = L4_MABX_P.Constant5_Value_b; |
| 24252 | L4_MABX_DW.Unit_Delay_59_DSTATE = L4_MABX_P.Constant10_Value_h; |
| 24253 | L4_MABX_DW.Unit_Delay_60_DSTATE = L4_MABX_P.Constant25_Value; |
| 24254 | L4_MABX_DW.Unit_Delay_61_DSTATE = L4_MABX_P.Constant6_Value_e; |
| 24255 | L4_MABX_DW.Unit_Delay_62_DSTATE = L4_MABX_P.Constant7_Value; |
| 24256 | L4_MABX_DW.Unit_Delay_63_DSTATE = L4_MABX_P.Constant8_Value; |
| 24257 | L4_MABX_DW.Unit_Delay_64_DSTATE = L4_MABX_P.Constant9_Value_m; |
| 24258 | L4_MABX_DW.Unit_Delay_65_DSTATE = L4_MABX_P.Constant11_Value; |
| 24259 | L4_MABX_DW.Unit_Delay_66_DSTATE = L4_MABX_P.Constant12_Value; |
| 24260 | L4_MABX_DW.Unit_Delay_67_DSTATE = L4_MABX_P.Constant13_Value; |
| 24261 | L4_MABX_DW.Unit_Delay_68_DSTATE = L4_MABX_P.Constant14_Value; |
| 24262 | L4_MABX_DW.Unit_Delay_69_DSTATE = L4_MABX_P.Constant19_Value_m; |
| 24263 | L4_MABX_DW.Unit_Delay_70_DSTATE = L4_MABX_P.Constant16_Value; |
| 24264 | L4_MABX_DW.Unit_Delay_71_DSTATE = L4_MABX_P.Constant21_Value_g; |
| 24265 | L4_MABX_DW.Unit_Delay_72_DSTATE = L4_MABX_P.Constant22_Value; |
| 24266 | L4_MABX_DW.Unit_Delay_73_DSTATE = L4_MABX_P.Constant15_Value; |
| 24267 | L4_MABX_DW.Unit_Delay_74_DSTATE = L4_MABX_P.Constant20_Value_i; |
| 24268 | L4_MABX_DW.Unit_Delay_75_DSTATE = L4_MABX_P.Constant17_Value; |
| 24269 | L4_MABX_DW.Unit_Delay_76_DSTATE = L4_MABX_P.Constant18_Value; |
| 24270 | L4_MABX_DW.Unit_Delay_77_DSTATE = L4_MABX_P.Constant23_Value; |
| 24271 | L4_MABX_DW.Unit_Delay_78_DSTATE = L4_MABX_B.Product_c; |
| 24272 | L4_MABX_DW.Unit_Delay_79_DSTATE = L4_MABX_P.Constant24_Value; |
| 24273 | } |
| 24274 | |
| 24275 | /* Model output function for TID2 */ |
| 24276 | void L4_MABX_output2(void) /* Sample time: [0.05s, 0.0s] */ |
| 24277 | { |
| 24278 | int_T tid = 2; |
| 24279 | |
| 24280 | /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_50ms' */ |
| 24281 | |
| 24282 | /* Outputs for Enabled SubSystem: '<S1054>/CCVS1_E3' incorporates: |
| 24283 | * EnablePort: '<S1056>/Enable' |
| 24284 | */ |
| 24285 | /* Constant: '<S858>/enable_CAN_TX_CCVS1_CAN3' */ |
| 24286 | if (L4_MABX_P.enable_CAN_TX_CCVS1_CAN3_Value > 0.0) { |
| 24287 | /* S-Function (rti_commonblock): '<S1056>/S-Function1' */ |
| 24288 | /* This comment workarounds a code generation problem */ |
| 24289 | |
| 24290 | /* dSPACE RTICAN TX Message Block: "CCVS1_E3" Id:419361251 */ |
| 24291 | { |
| 24292 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 24293 | |
| 24294 | Float32 delayTime = 0.0; |
| 24295 | |
| 24296 | /* ... Read status and timestamp info (previous message) */ |
| 24297 | can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]); |
| 24298 | |
| 24299 | /* Convert timestamp */ |
| 24300 | if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->processed) { |
| 24301 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->timestamp = |
| 24302 | rtk_dsts_time_to_simtime_convert |
| 24303 | (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->timestamp); |
| 24304 | } |
| 24305 | |
| 24306 | /* Messages with timestamp zero have been received in pause/stop state |
| 24307 | and must not be handled. |
| 24308 | */ |
| 24309 | if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->timestamp > 0.0) { |
| 24310 | L4_MABX_B.SFunction1_o1_j = (real_T) |
| 24311 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->processed; |
| 24312 | L4_MABX_B.SFunction1_o2_h4 = (real_T) |
| 24313 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->timestamp; |
| 24314 | L4_MABX_B.SFunction1_o3_f = (real_T) |
| 24315 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->deltatime; |
| 24316 | L4_MABX_B.SFunction1_o4_m = (real_T) |
| 24317 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->delaytime; |
| 24318 | } |
| 24319 | |
| 24320 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 24321 | { |
| 24322 | rtican_Signal_t CAN_Sgn; |
| 24323 | |
| 24324 | /* ...... "SPN69_TwoSpeedAxleSwitch" (0|2, standard signal, unsigned int, little endian) */ |
| 24325 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24326 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.TwoSpeedAxleSwitch ) + 0.5); |
| 24327 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24328 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24329 | |
| 24330 | /* ...... "SPN70_ParkingBrakeSwitch" (2|2, standard signal, unsigned int, little endian) */ |
| 24331 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24332 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkingBrakeSwitch ) + 0.5); |
| 24333 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24334 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24335 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24336 | |
| 24337 | /* ...... "SPN1633_CruiseControlPauseSwitch" (4|2, standard signal, unsigned int, little endian) */ |
| 24338 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24339 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlPauseSwitch ) + |
| 24340 | 0.5); |
| 24341 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24342 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24343 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24344 | |
| 24345 | /* ...... "SPN3807_ParkBrakeReleaseInhReq" (6|2, standard signal, unsigned int, little endian) */ |
| 24346 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24347 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkBrakeReleaseInhibitRq ) |
| 24348 | + 0.5); |
| 24349 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24350 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24351 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24352 | |
| 24353 | /* ...... "SPN84_WheelBasedVehicleSpeed" (8|16, standard signal, unsigned int, little endian) */ |
| 24354 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24355 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.WheelBasedVehicleSpeed_h - ( |
| 24356 | 0 ) ) / 0.00390625 + 0.5); |
| 24357 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 24358 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 24359 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte1; |
| 24360 | |
| 24361 | /* ...... "SPN595_CruiseControlActive" (24|2, standard signal, unsigned int, little endian) */ |
| 24362 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24363 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlActive ) + 0.5); |
| 24364 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24365 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24366 | |
| 24367 | /* ...... "SPN596_CruiseControlEnableSwitch" (26|2, standard signal, unsigned int, little endian) */ |
| 24368 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24369 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlEnableSwitch_n ) + |
| 24370 | 0.5); |
| 24371 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24372 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24373 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24374 | |
| 24375 | /* ...... "SPN597_BrakeSwitch" (28|2, standard signal, unsigned int, little endian) */ |
| 24376 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24377 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.BrakeSwitch_i ) + 0.5); |
| 24378 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24379 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24380 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24381 | |
| 24382 | /* ...... "SPN598_ClutchSwitch" (30|2, standard signal, unsigned int, little endian) */ |
| 24383 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24384 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ClutchSwitch ) + 0.5); |
| 24385 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24386 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24387 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24388 | |
| 24389 | /* ...... "SPN599_CruiseControlSetSwitch" (32|2, standard signal, unsigned int, little endian) */ |
| 24390 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24391 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSwitch ) + 0.5); |
| 24392 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24393 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24394 | |
| 24395 | /* ...... "SPN600_CruiseControlCoastDecelSw" (34|2, standard signal, unsigned int, little endian) */ |
| 24396 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24397 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlCoastSwitch ) + |
| 24398 | 0.5); |
| 24399 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24400 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24401 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24402 | |
| 24403 | /* ...... "SPN601_CruiseControlResumeSwitch" (36|2, standard signal, unsigned int, little endian) */ |
| 24404 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24405 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlResumeSwitch ) + |
| 24406 | 0.5); |
| 24407 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24408 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24409 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24410 | |
| 24411 | /* ...... "SPN602_CruiseControlAccelerateSw" (38|2, standard signal, unsigned int, little endian) */ |
| 24412 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24413 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlAccelerateSwitch ) |
| 24414 | + 0.5); |
| 24415 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24416 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24417 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24418 | |
| 24419 | /* ...... "SPN86_CruiseControlSetSpeed" (40|8, standard signal, unsigned int, little endian) */ |
| 24420 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24421 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSpeed ) + 0.5); |
| 24422 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 24423 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 24424 | |
| 24425 | /* ...... "SPN976_PTOGovernorState" (48|5, standard signal, unsigned int, little endian) */ |
| 24426 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24427 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.PTOGovernorState ) + 0.5); |
| 24428 | CAN_Sgn.UnsignedSgn &= 0x0000001F; |
| 24429 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 24430 | |
| 24431 | /* ...... "SPN527_CruiseControlStates" (53|3, standard signal, unsigned int, little endian) */ |
| 24432 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24433 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlStates ) + 0.5); |
| 24434 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 24435 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 5; |
| 24436 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 24437 | |
| 24438 | /* ...... "SPN968_EngIdleIncrementSw" (56|2, standard signal, unsigned int, little endian) */ |
| 24439 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24440 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleIncrementSwitch ) + |
| 24441 | 0.5); |
| 24442 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24443 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 24444 | |
| 24445 | /* ...... "SPN967_EngIdleDecrementSwitch" (58|2, standard signal, unsigned int, little endian) */ |
| 24446 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24447 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleDecrementSwitch ) + |
| 24448 | 0.5); |
| 24449 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24450 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24451 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 24452 | |
| 24453 | /* ...... "SPN966_EngDiagTestModeSwitch" (60|2, standard signal, unsigned int, little endian) */ |
| 24454 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24455 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngTestModeSwitch ) + 0.5); |
| 24456 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24457 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24458 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 24459 | |
| 24460 | /* ...... "SPN1237_EngShutdownOvrdSwitch" (62|2, standard signal, unsigned int, little endian) */ |
| 24461 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24462 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngShutdownOverrideSwitch ) |
| 24463 | + 0.5); |
| 24464 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24465 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24466 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 24467 | } |
| 24468 | |
| 24469 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 24470 | can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3], 8, |
| 24471 | &(CAN_Msg[0]), delayTime); |
| 24472 | } |
| 24473 | } |
| 24474 | |
| 24475 | /* End of Constant: '<S858>/enable_CAN_TX_CCVS1_CAN3' */ |
| 24476 | /* End of Outputs for SubSystem: '<S1054>/CCVS1_E3' */ |
| 24477 | |
| 24478 | /* Outputs for Enabled SubSystem: '<S1055>/TC1_03_05' incorporates: |
| 24479 | * EnablePort: '<S1057>/Enable' |
| 24480 | */ |
| 24481 | /* Constant: '<S1055>/CANT_TC1_03_05_APV' */ |
| 24482 | if (L4_MABX_P.CANT_TC1_03_05_APV_Value) { |
| 24483 | /* S-Function (rti_commonblock): '<S1057>/S-Function1' */ |
| 24484 | /* This comment workarounds a code generation problem */ |
| 24485 | |
| 24486 | /* dSPACE RTICAN TX Message Block: "TC1_03_05" Id:201392901 */ |
| 24487 | { |
| 24488 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 24489 | |
| 24490 | Float32 delayTime = 0.0; |
| 24491 | |
| 24492 | /* ... Read status and timestamp info (previous message) */ |
| 24493 | can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]); |
| 24494 | |
| 24495 | /* Convert timestamp */ |
| 24496 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->processed) { |
| 24497 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->timestamp = |
| 24498 | rtk_dsts_time_to_simtime_convert |
| 24499 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->timestamp); |
| 24500 | } |
| 24501 | |
| 24502 | /* Messages with timestamp zero have been received in pause/stop state |
| 24503 | and must not be handled. |
| 24504 | */ |
| 24505 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->timestamp > 0.0) { |
| 24506 | L4_MABX_B.SFunction1_o1_f = (real_T) |
| 24507 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->processed; |
| 24508 | L4_MABX_B.SFunction1_o2_o = (real_T) |
| 24509 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->timestamp; |
| 24510 | L4_MABX_B.SFunction1_o3_i = (real_T) |
| 24511 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->deltatime; |
| 24512 | L4_MABX_B.SFunction1_o4_d = (real_T) |
| 24513 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->delaytime; |
| 24514 | } |
| 24515 | |
| 24516 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 24517 | { |
| 24518 | rtican_Signal_t CAN_Sgn; |
| 24519 | |
| 24520 | /* ...... "SPN681_TransGearShiftInhibitReq" (0|2, standard signal, unsigned int, little endian) */ |
| 24521 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24522 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24523 | (( L4_MABX_B.SPN681_TransGearShiftInhibitReq ) + 0.5); |
| 24524 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24525 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24526 | |
| 24527 | /* ...... "SPN682_TransTrqConvLockupDisReq" (2|2, standard signal, unsigned int, little endian) */ |
| 24528 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24529 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24530 | (( L4_MABX_B.SPN682_TransTrqConvLockupDisReq ) + 0.5); |
| 24531 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24532 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24533 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24534 | |
| 24535 | /* ...... "SPN683_DisengageDrivelineReq" (4|2, standard signal, unsigned int, little endian) */ |
| 24536 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24537 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN683_DisengageDrivelineReq |
| 24538 | ) + 0.5); |
| 24539 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24540 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24541 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24542 | |
| 24543 | /* ...... "SPN4242_TransRevGearShiftInhibRq" (6|2, standard signal, unsigned int, little endian) */ |
| 24544 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24545 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24546 | (( L4_MABX_B.SPN4242_TransRevGearShiftInhibR ) + 0.5); |
| 24547 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24548 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24549 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 24550 | |
| 24551 | /* ...... "SPN684_RequestedPercClutchSlip" (8|8, standard signal, unsigned int, little endian) */ |
| 24552 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24553 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24554 | (( L4_MABX_B.SPN684_RequestedPercClutchSlip - ( 0 ) ) / 0.4 + 0.5); |
| 24555 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 24556 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 24557 | |
| 24558 | /* ...... "SPN525_TransRequestedGear" (16|8, standard signal, unsigned int, little endian) */ |
| 24559 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24560 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.SPN525_TransRequestedGear - ( |
| 24561 | -125 ) + 0.5); |
| 24562 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 24563 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 24564 | |
| 24565 | /* ...... "SPN685_DisengageDiffLockRqFrAx1" (24|2, standard signal, unsigned int, little endian) */ |
| 24566 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24567 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24568 | (( L4_MABX_B.SPN685_DisengageDiffLockRqFrAx1 ) + 0.5); |
| 24569 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24570 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24571 | |
| 24572 | /* ...... "SPN686_DisengageDiffLockRqFrAx2" (26|2, standard signal, unsigned int, little endian) */ |
| 24573 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24574 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24575 | (( L4_MABX_B.SPN686_DisengageDiffLockRqFrAx2 ) + 0.5); |
| 24576 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24577 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24578 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24579 | |
| 24580 | /* ...... "SPN687_DisengageDiffLockRqRrAx1" (28|2, standard signal, unsigned int, little endian) */ |
| 24581 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24582 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24583 | (( L4_MABX_B.SPN687_DisengageDiffLockRqRrAx1 ) + 0.5); |
| 24584 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24585 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24586 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24587 | |
| 24588 | /* ...... "SPN688_DisengageDiffLockRqRrAx2" (30|2, standard signal, unsigned int, little endian) */ |
| 24589 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24590 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24591 | (( L4_MABX_B.SPN688_DisengageDiffLockRqRrAx2 ) + 0.5); |
| 24592 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24593 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24594 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 24595 | |
| 24596 | /* ...... "SPN689_DisengageDiffLockRqC" (32|2, standard signal, unsigned int, little endian) */ |
| 24597 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24598 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN689_DisengageDiffLockRqC ) |
| 24599 | + 0.5); |
| 24600 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24601 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24602 | |
| 24603 | /* ...... "SPN690_DisengageDiffLockRqCF" (34|2, standard signal, unsigned int, little endian) */ |
| 24604 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24605 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN690_DisengageDiffLockRqCF |
| 24606 | ) + 0.5); |
| 24607 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24608 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24609 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24610 | |
| 24611 | /* ...... "SPN691_DisengageDiffLockRqCR" (36|2, standard signal, unsigned int, little endian) */ |
| 24612 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24613 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN691_DisengageDiffLockRqCR |
| 24614 | ) + 0.5); |
| 24615 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24616 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24617 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24618 | |
| 24619 | /* ...... "SPN5762_TransLoadRedInhibitRq" (38|2, standard signal, unsigned int, little endian) */ |
| 24620 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24621 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24622 | (( L4_MABX_B.SPN5762_TransLoadRedInhibitRq ) + 0.5); |
| 24623 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24624 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24625 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 24626 | |
| 24627 | /* ...... "SPN1852_TransmissionMode1" (40|2, standard signal, unsigned int, little endian) */ |
| 24628 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24629 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN1852_TransmissionMode1 ) |
| 24630 | + 0.5); |
| 24631 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24632 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 24633 | |
| 24634 | /* ...... "SPN1853_TransmissionMode2" (42|2, standard signal, unsigned int, little endian) */ |
| 24635 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24636 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN1853_TransmissionMode2 ) |
| 24637 | + 0.5); |
| 24638 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24639 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24640 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 24641 | |
| 24642 | /* ...... "SPN1854_TransmissionMode3" (44|2, standard signal, unsigned int, little endian) */ |
| 24643 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24644 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN1854_TransmissionMode3 ) |
| 24645 | + 0.5); |
| 24646 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24647 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24648 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 24649 | |
| 24650 | /* ...... "SPN1855_TransmissionMode4" (46|2, standard signal, unsigned int, little endian) */ |
| 24651 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24652 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN1855_TransmissionMode4 ) |
| 24653 | + 0.5); |
| 24654 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24655 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24656 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 24657 | |
| 24658 | /* ...... "SPN7695_TransAutoNeutralRequest" (48|2, standard signal, unsigned int, little endian) */ |
| 24659 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24660 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24661 | (( L4_MABX_B.SPN7695_TransAutoNeutralRequest ) + 0.5); |
| 24662 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24663 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 24664 | |
| 24665 | /* ...... "SPN4255_TransRequestedLaunchGear" (50|4, standard signal, unsigned int, little endian) */ |
| 24666 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24667 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24668 | (( L4_MABX_B.SPN4255_TransRequestedLaunchGea ) + 0.5); |
| 24669 | CAN_Sgn.UnsignedSgn &= 0x0000000F; |
| 24670 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24671 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 24672 | |
| 24673 | /* ...... "SPN2985_TransShiftSelDispModeSw" (54|2, standard signal, unsigned int, little endian) */ |
| 24674 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24675 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 24676 | (( L4_MABX_B.SPN2985_TransShiftSelDispModeSw ) + 0.5); |
| 24677 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24678 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24679 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 24680 | |
| 24681 | /* ...... "SPN4246_TransmissionMode5" (56|2, standard signal, unsigned int, little endian) */ |
| 24682 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24683 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN4246_TransmissionMode5 ) |
| 24684 | + 0.5); |
| 24685 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24686 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 24687 | |
| 24688 | /* ...... "SPN4247_TransmissionMode6" (58|2, standard signal, unsigned int, little endian) */ |
| 24689 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24690 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN4247_TransmissionMode6 ) |
| 24691 | + 0.5); |
| 24692 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24693 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 24694 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 24695 | |
| 24696 | /* ...... "SPN4248_TransmissionMode7" (60|2, standard signal, unsigned int, little endian) */ |
| 24697 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24698 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN4248_TransmissionMode7 ) |
| 24699 | + 0.5); |
| 24700 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24701 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 24702 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 24703 | |
| 24704 | /* ...... "SPN4249_TransmissionMode8" (62|2, standard signal, unsigned int, little endian) */ |
| 24705 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 24706 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN4249_TransmissionMode8 ) |
| 24707 | + 0.5); |
| 24708 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 24709 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 24710 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 24711 | } |
| 24712 | |
| 24713 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 24714 | can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305], 8, |
| 24715 | &(CAN_Msg[0]), delayTime); |
| 24716 | } |
| 24717 | } |
| 24718 | |
| 24719 | /* End of Constant: '<S1055>/CANT_TC1_03_05_APV' */ |
| 24720 | /* End of Outputs for SubSystem: '<S1055>/TC1_03_05' */ |
| 24721 | |
| 24722 | /* End of Outputs for SubSystem: '<S849>/CAN_TX_50ms' */ |
| 24723 | /* user code (Output function Trailer for TID2) */ |
| 24724 | |
| 24725 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 24726 | /* EventChannel: 0 */ |
| 24727 | if (tid == 0) { |
| 24728 | DSXCP_service(0); |
| 24729 | } |
| 24730 | |
| 24731 | /* If subsystem generates rate grouping Output functions, |
| 24732 | * when tid is used in Output function for one rate, |
| 24733 | * all Output functions include tid as a local variable. |
| 24734 | * As result, some Output functions may have unused tid. |
| 24735 | */ |
| 24736 | UNUSED_PARAMETER(tid); |
| 24737 | } |
| 24738 | |
| 24739 | /* Model update function for TID2 */ |
| 24740 | void L4_MABX_update2(void) /* Sample time: [0.05s, 0.0s] */ |
| 24741 | { |
| 24742 | /* (no update code required) */ |
| 24743 | } |
| 24744 | |
| 24745 | /* Model output function for TID3 */ |
| 24746 | void L4_MABX_output3(void) /* Sample time: [0.1s, 0.0s] */ |
| 24747 | { |
| 24748 | int_T tid = 3; |
| 24749 | uint16_T tmp; |
| 24750 | uint32_T tmp_0; |
| 24751 | uint8_T tmp_1; |
| 24752 | real_T tmp_2; |
| 24753 | |
| 24754 | /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_100ms' */ |
| 24755 | |
| 24756 | /* DataTypeConversion: '<S886>/Data Type Conversion' incorporates: |
| 24757 | * Constant: '<S853>/PROPB_XPR_INHIBIT_PARK_MANUAL_APV' |
| 24758 | */ |
| 24759 | L4_MABX_B.DataTypeConversion_kb1 = (uint8_T) |
| 24760 | L4_MABX_P.PROPB_XPR_INHIBIT_PARK_MANUAL_A; |
| 24761 | |
| 24762 | /* S-Function (sfix_bitop): '<S918>/Operator' */ |
| 24763 | L4_MABX_B.Operator_mm = (uint8_T)(L4_MABX_B.DataTypeConversion_kb1 & |
| 24764 | L4_MABX_P.Operator_BitMask_an); |
| 24765 | |
| 24766 | /* DataTypeConversion: '<S918>/DataType' */ |
| 24767 | L4_MABX_B.DataType_li = L4_MABX_B.Operator_mm; |
| 24768 | |
| 24769 | /* DataTypeConversion: '<S886>/Data Type Conversion2' incorporates: |
| 24770 | * Constant: '<S853>/PROPB_XPR_INHIBIT_UNPARK_MANUAL_APV' |
| 24771 | */ |
| 24772 | L4_MABX_B.DataTypeConversion2_bg = (uint8_T) |
| 24773 | L4_MABX_P.PROPB_XPR_INHIBIT_UNPARK_MANUAL; |
| 24774 | |
| 24775 | /* S-Function (sfix_bitop): '<S920>/Operator' */ |
| 24776 | L4_MABX_B.Operator_cu = (uint8_T)(L4_MABX_B.DataTypeConversion2_bg & |
| 24777 | L4_MABX_P.Operator_BitMask_do); |
| 24778 | |
| 24779 | /* DataTypeConversion: '<S920>/DataType' */ |
| 24780 | L4_MABX_B.DataType_lv = L4_MABX_B.Operator_cu; |
| 24781 | |
| 24782 | /* ArithShift: '<S886>/Shift_Arithmetic ' */ |
| 24783 | L4_MABX_B.Shift_Arithmetic_g = (uint8_T)(L4_MABX_B.DataType_lv << 2); |
| 24784 | |
| 24785 | /* DataTypeConversion: '<S886>/Data Type Conversion4' incorporates: |
| 24786 | * Constant: '<S853>/PROPB_XPR_PARK_MANUAL_APV' |
| 24787 | */ |
| 24788 | L4_MABX_B.DataTypeConversion4_ju = (uint8_T) |
| 24789 | L4_MABX_P.PROPB_XPR_PARK_MANUAL_APV_Value; |
| 24790 | |
| 24791 | /* S-Function (sfix_bitop): '<S921>/Operator' */ |
| 24792 | L4_MABX_B.Operator_fc = (uint8_T)(L4_MABX_B.DataTypeConversion4_ju & |
| 24793 | L4_MABX_P.Operator_BitMask_dd); |
| 24794 | |
| 24795 | /* DataTypeConversion: '<S921>/DataType' */ |
| 24796 | L4_MABX_B.DataType_eq = L4_MABX_B.Operator_fc; |
| 24797 | |
| 24798 | /* ArithShift: '<S886>/Shift_Arithmetic 1' */ |
| 24799 | L4_MABX_B.Shift_Arithmetic1_e = (uint8_T)(L4_MABX_B.DataType_eq << 4); |
| 24800 | |
| 24801 | /* DataTypeConversion: '<S886>/Data Type Conversion5' incorporates: |
| 24802 | * Constant: '<S853>/PROPB_XPR_UNPARK_MANUAL_APV' |
| 24803 | */ |
| 24804 | L4_MABX_B.DataTypeConversion5_j = (uint8_T) |
| 24805 | L4_MABX_P.PROPB_XPR_UNPARK_MANUAL_APV_Val; |
| 24806 | |
| 24807 | /* S-Function (sfix_bitop): '<S919>/Operator' */ |
| 24808 | L4_MABX_B.Operator_ho = (uint8_T)(L4_MABX_B.DataTypeConversion5_j & |
| 24809 | L4_MABX_P.Operator_BitMask_gg); |
| 24810 | |
| 24811 | /* DataTypeConversion: '<S919>/DataType' */ |
| 24812 | L4_MABX_B.DataType_n4o = L4_MABX_B.Operator_ho; |
| 24813 | |
| 24814 | /* ArithShift: '<S886>/Shift_Arithmetic 2' */ |
| 24815 | L4_MABX_B.Shift_Arithmetic2_b1 = (uint8_T)(L4_MABX_B.DataType_n4o << 6); |
| 24816 | |
| 24817 | /* S-Function (sfix_bitop): '<S926>/Operator' */ |
| 24818 | L4_MABX_B.Operator_ai = (uint8_T)(L4_MABX_B.DataType_li | |
| 24819 | L4_MABX_B.Shift_Arithmetic_g | L4_MABX_B.Shift_Arithmetic1_e | |
| 24820 | L4_MABX_B.Shift_Arithmetic2_b1); |
| 24821 | |
| 24822 | /* DataTypeConversion: '<S926>/DataType' */ |
| 24823 | L4_MABX_B.DataType_di = L4_MABX_B.Operator_ai; |
| 24824 | |
| 24825 | /* Outputs for Enabled SubSystem: '<S886>/Rolling_15_counter' incorporates: |
| 24826 | * EnablePort: '<S928>/Enable' |
| 24827 | */ |
| 24828 | if (L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_R) { |
| 24829 | /* UnitDelay: '<S928>/Unit_Delay' */ |
| 24830 | L4_MABX_B.Unit_Delay = L4_MABX_DW.Unit_Delay_DSTATE; |
| 24831 | |
| 24832 | /* Sum: '<S936>/FixPt Sum1' incorporates: |
| 24833 | * Constant: '<S936>/FixPt Constant' |
| 24834 | */ |
| 24835 | L4_MABX_B.FixPtSum1_f3 = L4_MABX_B.Unit_Delay + |
| 24836 | L4_MABX_P.FixPtConstant_Value; |
| 24837 | |
| 24838 | /* Switch: '<S937>/FixPt Switch' incorporates: |
| 24839 | * Constant: '<S937>/Constant' |
| 24840 | */ |
| 24841 | if (L4_MABX_B.FixPtSum1_f3 > L4_MABX_P.WrapToZero1_Threshold) { |
| 24842 | L4_MABX_B.FixPtSwitch = L4_MABX_P.Constant_Value_j; |
| 24843 | } else { |
| 24844 | L4_MABX_B.FixPtSwitch = L4_MABX_B.FixPtSum1_f3; |
| 24845 | } |
| 24846 | |
| 24847 | /* End of Switch: '<S937>/FixPt Switch' */ |
| 24848 | } |
| 24849 | |
| 24850 | /* End of Outputs for SubSystem: '<S886>/Rolling_15_counter' */ |
| 24851 | |
| 24852 | /* DataTypeConversion: '<S886>/Data Type Conversion1' */ |
| 24853 | tmp_2 = L4_MABX_B.Unit_Delay; |
| 24854 | if (tmp_2 < 256.0) { |
| 24855 | if (tmp_2 >= 0.0) { |
| 24856 | tmp_1 = (uint8_T)tmp_2; |
| 24857 | } else { |
| 24858 | tmp_1 = 0U; |
| 24859 | } |
| 24860 | } else { |
| 24861 | tmp_1 = MAX_uint8_T; |
| 24862 | } |
| 24863 | |
| 24864 | L4_MABX_B.DataTypeConversion1_mq = tmp_1; |
| 24865 | |
| 24866 | /* End of DataTypeConversion: '<S886>/Data Type Conversion1' */ |
| 24867 | |
| 24868 | /* S-Function (sfix_bitop): '<S922>/Operator' */ |
| 24869 | L4_MABX_B.Operator_j4 = (uint8_T)(L4_MABX_B.DataTypeConversion1_mq & |
| 24870 | L4_MABX_P.Operator_BitMask_mo); |
| 24871 | |
| 24872 | /* DataTypeConversion: '<S922>/DataType' */ |
| 24873 | L4_MABX_B.DataType_aj = L4_MABX_B.Operator_j4; |
| 24874 | |
| 24875 | /* DataTypeConversion: '<S925>/Data Type Conversion' incorporates: |
| 24876 | * Constant: '<S925>/Priority' |
| 24877 | */ |
| 24878 | L4_MABX_B.DataTypeConversion_ip = L4_MABX_P.Priority_Value; |
| 24879 | |
| 24880 | /* ArithShift: '<S925>/Shift_Arithmetic ' */ |
| 24881 | L4_MABX_B.Shift_Arithmetic_b = L4_MABX_B.DataTypeConversion_ip << 26; |
| 24882 | |
| 24883 | /* DataTypeConversion: '<S925>/Data Type Conversion1' incorporates: |
| 24884 | * Constant: '<S925>/ExtendedDataPage' |
| 24885 | */ |
| 24886 | L4_MABX_B.DataTypeConversion1_np = L4_MABX_P.ExtendedDataPage_Value; |
| 24887 | |
| 24888 | /* ArithShift: '<S925>/Shift_Arithmetic 1' */ |
| 24889 | L4_MABX_B.Shift_Arithmetic1_o = L4_MABX_B.DataTypeConversion1_np << 25; |
| 24890 | |
| 24891 | /* DataTypeConversion: '<S925>/Data Type Conversion2' incorporates: |
| 24892 | * Constant: '<S925>/DataPage' |
| 24893 | */ |
| 24894 | L4_MABX_B.DataTypeConversion2_k1 = L4_MABX_P.DataPage_Value; |
| 24895 | |
| 24896 | /* ArithShift: '<S925>/Shift_Arithmetic 2' */ |
| 24897 | L4_MABX_B.Shift_Arithmetic2_lt = L4_MABX_B.DataTypeConversion2_k1 << 24; |
| 24898 | |
| 24899 | /* DataTypeConversion: '<S925>/Data Type Conversion3' incorporates: |
| 24900 | * Constant: '<S925>/PDUFormat' |
| 24901 | */ |
| 24902 | L4_MABX_B.DataTypeConversion3_cp = L4_MABX_P.PDUFormat_Value; |
| 24903 | |
| 24904 | /* ArithShift: '<S925>/Shift_Arithmetic 3' */ |
| 24905 | L4_MABX_B.Shift_Arithmetic3_i = L4_MABX_B.DataTypeConversion3_cp << 16; |
| 24906 | |
| 24907 | /* DataTypeConversion: '<S925>/Data Type Conversion4' incorporates: |
| 24908 | * Constant: '<S925>/PDUSpecific' |
| 24909 | */ |
| 24910 | L4_MABX_B.DataTypeConversion4_p = L4_MABX_P.PDUSpecific_Value; |
| 24911 | |
| 24912 | /* ArithShift: '<S925>/Shift_Arithmetic 4' */ |
| 24913 | L4_MABX_B.Shift_Arithmetic4_fd = L4_MABX_B.DataTypeConversion4_p << 8; |
| 24914 | |
| 24915 | /* DataTypeConversion: '<S925>/Data Type Conversion5' incorporates: |
| 24916 | * Constant: '<S925>/SourceAddress' |
| 24917 | */ |
| 24918 | L4_MABX_B.DataTypeConversion5_e = L4_MABX_P.SourceAddress_Value; |
| 24919 | |
| 24920 | /* S-Function (sfix_bitop): '<S935>/Operator' */ |
| 24921 | L4_MABX_B.Operator_d = L4_MABX_B.Shift_Arithmetic_b | |
| 24922 | L4_MABX_B.Shift_Arithmetic1_o | L4_MABX_B.Shift_Arithmetic2_lt | |
| 24923 | L4_MABX_B.Shift_Arithmetic3_i | L4_MABX_B.Shift_Arithmetic4_fd | |
| 24924 | L4_MABX_B.DataTypeConversion5_e; |
| 24925 | |
| 24926 | /* DataTypeConversion: '<S935>/DataType' */ |
| 24927 | L4_MABX_B.DataType_a0 = L4_MABX_B.Operator_d; |
| 24928 | |
| 24929 | /* DataTypeConversion: '<S924>/Data Type Conversion8' */ |
| 24930 | L4_MABX_B.DataTypeConversion8_o = L4_MABX_B.DataType_a0; |
| 24931 | |
| 24932 | /* S-Function (sfix_bitop): '<S931>/Operator' */ |
| 24933 | L4_MABX_B.Operator_oq = L4_MABX_B.DataTypeConversion8_o & |
| 24934 | L4_MABX_P.Operator_BitMask_gf; |
| 24935 | |
| 24936 | /* DataTypeConversion: '<S931>/DataType' */ |
| 24937 | tmp_0 = L4_MABX_B.Operator_oq; |
| 24938 | if (tmp_0 > 255U) { |
| 24939 | tmp_0 = 255U; |
| 24940 | } |
| 24941 | |
| 24942 | L4_MABX_B.DataType_ny = (uint8_T)tmp_0; |
| 24943 | |
| 24944 | /* End of DataTypeConversion: '<S931>/DataType' */ |
| 24945 | |
| 24946 | /* S-Function (sfix_bitop): '<S932>/Operator' */ |
| 24947 | L4_MABX_B.Operator_l = L4_MABX_B.DataTypeConversion8_o & |
| 24948 | L4_MABX_P.Operator_BitMask_af; |
| 24949 | |
| 24950 | /* DataTypeConversion: '<S932>/DataType' */ |
| 24951 | tmp_0 = L4_MABX_B.Operator_l; |
| 24952 | if (tmp_0 > 65535U) { |
| 24953 | tmp_0 = 65535U; |
| 24954 | } |
| 24955 | |
| 24956 | L4_MABX_B.DataType_ic = (uint16_T)tmp_0; |
| 24957 | |
| 24958 | /* End of DataTypeConversion: '<S932>/DataType' */ |
| 24959 | |
| 24960 | /* ArithShift: '<S924>/Shift_Arithmetic 3' */ |
| 24961 | L4_MABX_B.Shift_Arithmetic3_f5 = (uint16_T)((uint32_T)L4_MABX_B.DataType_ic >> |
| 24962 | 8); |
| 24963 | |
| 24964 | /* DataTypeConversion: '<S924>/Data Type Conversion9' */ |
| 24965 | tmp = L4_MABX_B.Shift_Arithmetic3_f5; |
| 24966 | if (tmp > 255) { |
| 24967 | tmp = 255U; |
| 24968 | } |
| 24969 | |
| 24970 | L4_MABX_B.MessageIDMidLowByte = (uint8_T)tmp; |
| 24971 | |
| 24972 | /* End of DataTypeConversion: '<S924>/Data Type Conversion9' */ |
| 24973 | |
| 24974 | /* S-Function (sfix_bitop): '<S933>/Operator' */ |
| 24975 | L4_MABX_B.Operator_m = L4_MABX_B.DataTypeConversion8_o & |
| 24976 | L4_MABX_P.Operator_BitMask_ck; |
| 24977 | |
| 24978 | /* DataTypeConversion: '<S933>/DataType' */ |
| 24979 | L4_MABX_B.DataType_fp = L4_MABX_B.Operator_m; |
| 24980 | |
| 24981 | /* ArithShift: '<S924>/Shift_Arithmetic 4' */ |
| 24982 | L4_MABX_B.Shift_Arithmetic4_l = L4_MABX_B.DataType_fp >> 16; |
| 24983 | |
| 24984 | /* DataTypeConversion: '<S924>/Data Type Conversion10' */ |
| 24985 | tmp_0 = L4_MABX_B.Shift_Arithmetic4_l; |
| 24986 | if (tmp_0 > 255U) { |
| 24987 | tmp_0 = 255U; |
| 24988 | } |
| 24989 | |
| 24990 | L4_MABX_B.MessageIDMidHighByte = (uint8_T)tmp_0; |
| 24991 | |
| 24992 | /* End of DataTypeConversion: '<S924>/Data Type Conversion10' */ |
| 24993 | |
| 24994 | /* S-Function (sfix_bitop): '<S934>/Operator' */ |
| 24995 | L4_MABX_B.Operator_p4 = L4_MABX_B.DataTypeConversion8_o & |
| 24996 | L4_MABX_P.Operator_BitMask_bh; |
| 24997 | |
| 24998 | /* DataTypeConversion: '<S934>/DataType' */ |
| 24999 | L4_MABX_B.DataType_pt = L4_MABX_B.Operator_p4; |
| 25000 | |
| 25001 | /* ArithShift: '<S924>/Shift_Arithmetic 5' */ |
| 25002 | L4_MABX_B.Shift_Arithmetic5_bd = L4_MABX_B.DataType_pt >> 24; |
| 25003 | |
| 25004 | /* DataTypeConversion: '<S924>/Data Type Conversion11' */ |
| 25005 | tmp_0 = L4_MABX_B.Shift_Arithmetic5_bd; |
| 25006 | if (tmp_0 > 255U) { |
| 25007 | tmp_0 = 255U; |
| 25008 | } |
| 25009 | |
| 25010 | L4_MABX_B.MessageIDHighByte = (uint8_T)tmp_0; |
| 25011 | |
| 25012 | /* End of DataTypeConversion: '<S924>/Data Type Conversion11' */ |
| 25013 | |
| 25014 | /* DataTypeConversion: '<S924>/Data Type Conversion13' */ |
| 25015 | tmp_2 = L4_MABX_B.Unit_Delay; |
| 25016 | if (tmp_2 < 256.0) { |
| 25017 | if (tmp_2 >= 0.0) { |
| 25018 | tmp_1 = (uint8_T)tmp_2; |
| 25019 | } else { |
| 25020 | tmp_1 = 0U; |
| 25021 | } |
| 25022 | } else { |
| 25023 | tmp_1 = MAX_uint8_T; |
| 25024 | } |
| 25025 | |
| 25026 | L4_MABX_B.DataTypeConversion13_m = tmp_1; |
| 25027 | |
| 25028 | /* End of DataTypeConversion: '<S924>/Data Type Conversion13' */ |
| 25029 | |
| 25030 | /* S-Function (sfix_bitop): '<S930>/Operator' */ |
| 25031 | L4_MABX_B.Operator_ef = (uint8_T)(L4_MABX_B.DataTypeConversion13_m & |
| 25032 | L4_MABX_P.Operator_BitMask_hx); |
| 25033 | |
| 25034 | /* DataTypeConversion: '<S930>/DataType' */ |
| 25035 | L4_MABX_B.DataType_it = L4_MABX_B.Operator_ef; |
| 25036 | |
| 25037 | /* Sum: '<S924>/Add' incorporates: |
| 25038 | * Constant: '<S886>/Constant3' |
| 25039 | */ |
| 25040 | L4_MABX_B.Checksum = (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T) |
| 25041 | ((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T) |
| 25042 | (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T) |
| 25043 | ((uint32_T)(uint8_T)((uint32_T)L4_MABX_B.DataType_di + |
| 25044 | L4_MABX_P.Constant3_Value_b) + L4_MABX_P.Constant3_Value_b) + |
| 25045 | L4_MABX_P.Constant3_Value_b) + L4_MABX_P.Constant3_Value_b) + |
| 25046 | L4_MABX_P.Constant3_Value_b) + L4_MABX_P.Constant3_Value_b) + |
| 25047 | L4_MABX_B.DataType_ny) + L4_MABX_B.MessageIDMidLowByte) + |
| 25048 | L4_MABX_B.MessageIDMidHighByte) + L4_MABX_B.MessageIDHighByte) + |
| 25049 | L4_MABX_B.DataType_it); |
| 25050 | |
| 25051 | /* ArithShift: '<S924>/Shift_Arithmetic 7' */ |
| 25052 | L4_MABX_B.Shift_Arithmetic7_hq = (uint8_T)((uint32_T)L4_MABX_B.Checksum >> 4); |
| 25053 | |
| 25054 | /* Sum: '<S924>/Add1' */ |
| 25055 | L4_MABX_B.Add1_ep = (uint8_T)((uint32_T)L4_MABX_B.Shift_Arithmetic7_hq + |
| 25056 | L4_MABX_B.Checksum); |
| 25057 | |
| 25058 | /* S-Function (sfix_bitop): '<S929>/Operator' */ |
| 25059 | L4_MABX_B.Operator_lt = (uint8_T)(L4_MABX_B.Add1_ep & |
| 25060 | L4_MABX_P.Operator_BitMask_e); |
| 25061 | |
| 25062 | /* DataTypeConversion: '<S929>/DataType' */ |
| 25063 | L4_MABX_B.DataType_gh = L4_MABX_B.Operator_lt; |
| 25064 | |
| 25065 | /* DataTypeConversion: '<S886>/Data Type Conversion3' */ |
| 25066 | L4_MABX_B.DataTypeConversion3_j = L4_MABX_B.DataType_gh; |
| 25067 | |
| 25068 | /* S-Function (sfix_bitop): '<S923>/Operator' */ |
| 25069 | L4_MABX_B.Operator_gv = (uint8_T)(L4_MABX_B.DataTypeConversion3_j & |
| 25070 | L4_MABX_P.Operator_BitMask_o); |
| 25071 | |
| 25072 | /* DataTypeConversion: '<S923>/DataType' */ |
| 25073 | L4_MABX_B.DataType_or = L4_MABX_B.Operator_gv; |
| 25074 | |
| 25075 | /* ArithShift: '<S886>/Shift_Arithmetic 3' */ |
| 25076 | L4_MABX_B.Shift_Arithmetic3_hc = (uint8_T)(L4_MABX_B.DataType_or << 4); |
| 25077 | |
| 25078 | /* S-Function (sfix_bitop): '<S927>/Operator' */ |
| 25079 | L4_MABX_B.Operator_fpo = (uint8_T)(L4_MABX_B.DataType_aj | |
| 25080 | L4_MABX_B.Shift_Arithmetic3_hc); |
| 25081 | |
| 25082 | /* DataTypeConversion: '<S927>/DataType' */ |
| 25083 | L4_MABX_B.DataType_gt = L4_MABX_B.Operator_fpo; |
| 25084 | |
| 25085 | /* DataTypeConversion: '<S881>/Data Type Conversion1' incorporates: |
| 25086 | * Constant: '<S886>/Constant3' |
| 25087 | */ |
| 25088 | L4_MABX_B.DataTypeConversion1_at[0] = L4_MABX_B.DataType_di; |
| 25089 | L4_MABX_B.DataTypeConversion1_at[1] = L4_MABX_P.Constant3_Value_b; |
| 25090 | L4_MABX_B.DataTypeConversion1_at[2] = L4_MABX_P.Constant3_Value_b; |
| 25091 | L4_MABX_B.DataTypeConversion1_at[3] = L4_MABX_P.Constant3_Value_b; |
| 25092 | L4_MABX_B.DataTypeConversion1_at[4] = L4_MABX_P.Constant3_Value_b; |
| 25093 | L4_MABX_B.DataTypeConversion1_at[5] = L4_MABX_P.Constant3_Value_b; |
| 25094 | L4_MABX_B.DataTypeConversion1_at[6] = L4_MABX_P.Constant3_Value_b; |
| 25095 | L4_MABX_B.DataTypeConversion1_at[7] = L4_MABX_B.DataType_gt; |
| 25096 | |
| 25097 | /* DataTypeConversion: '<S881>/Data Type Conversion' incorporates: |
| 25098 | * Constant: '<S853>/CANT_PROPB_XPR_FC_CHANNEL_APV' |
| 25099 | */ |
| 25100 | L4_MABX_B.DataTypeConversion_oh3 = (uint8_T) |
| 25101 | L4_MABX_P.CANT_PROPB_XPR_FC_CHANNEL_APV_V; |
| 25102 | |
| 25103 | /* S-Function (sfix_bitop): '<S896>/Operator' */ |
| 25104 | L4_MABX_B.Operator_olp = (uint8_T)(L4_MABX_B.DataTypeConversion_oh3 & |
| 25105 | L4_MABX_P.Operator_BitMask_cn); |
| 25106 | |
| 25107 | /* DataTypeConversion: '<S896>/DataType' */ |
| 25108 | L4_MABX_B.DataType_h = L4_MABX_B.Operator_olp; |
| 25109 | |
| 25110 | /* DataTypeConversion: '<S881>/Data Type Conversion2' */ |
| 25111 | L4_MABX_B.DataTypeConversion2_i1 = (L4_MABX_B.DataType_h != 0); |
| 25112 | |
| 25113 | /* Logic: '<S904>/Operator' */ |
| 25114 | L4_MABX_B.Operator_fg = (L4_MABX_B.TmpRTBAtOperatorInport1 && |
| 25115 | L4_MABX_B.DataTypeConversion2_i1); |
| 25116 | |
| 25117 | /* DataTypeConversion: '<S904>/DataType' */ |
| 25118 | L4_MABX_B.DataType_nhd = L4_MABX_B.Operator_fg; |
| 25119 | |
| 25120 | /* Outputs for Enabled SubSystem: '<S908>/PropB_XPR_FC' incorporates: |
| 25121 | * EnablePort: '<S910>/Enable' |
| 25122 | */ |
| 25123 | if (L4_MABX_B.DataType_nhd) { |
| 25124 | /* S-Function (rti_commonblock): '<S910>/S-Function1' */ |
| 25125 | /* This comment workarounds a code generation problem */ |
| 25126 | |
| 25127 | /* dSPACE RTICAN TX Message Block: "PropB_XPR_FC" Id:419366140 */ |
| 25128 | { |
| 25129 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 25130 | |
| 25131 | Float32 delayTime = 0.0; |
| 25132 | |
| 25133 | /* ... Read status and timestamp info (previous message) */ |
| 25134 | can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]); |
| 25135 | |
| 25136 | /* Convert timestamp */ |
| 25137 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->processed) { |
| 25138 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->timestamp = |
| 25139 | rtk_dsts_time_to_simtime_convert |
| 25140 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->timestamp); |
| 25141 | } |
| 25142 | |
| 25143 | /* Messages with timestamp zero have been received in pause/stop state |
| 25144 | and must not be handled. |
| 25145 | */ |
| 25146 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->timestamp > 0.0) { |
| 25147 | L4_MABX_B.SFunction1_o1_fs = (real_T) |
| 25148 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->processed; |
| 25149 | L4_MABX_B.SFunction1_o2_l = (real_T) |
| 25150 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->timestamp; |
| 25151 | L4_MABX_B.SFunction1_o3_b = (real_T) |
| 25152 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->deltatime; |
| 25153 | L4_MABX_B.SFunction1_o4_a3 = (real_T) |
| 25154 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->delaytime; |
| 25155 | } |
| 25156 | |
| 25157 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 25158 | { |
| 25159 | rtican_Signal_t CAN_Sgn; |
| 25160 | |
| 25161 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 25162 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25163 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_at[0] ) |
| 25164 | + 0.5); |
| 25165 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25166 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25167 | |
| 25168 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 25169 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25170 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_at[1] ) |
| 25171 | + 0.5); |
| 25172 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25173 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 25174 | |
| 25175 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 25176 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25177 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_at[2] ) |
| 25178 | + 0.5); |
| 25179 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25180 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 25181 | |
| 25182 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 25183 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25184 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_at[3] ) |
| 25185 | + 0.5); |
| 25186 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25187 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 25188 | |
| 25189 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 25190 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25191 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_at[4] ) |
| 25192 | + 0.5); |
| 25193 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25194 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25195 | |
| 25196 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 25197 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25198 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_at[5] ) |
| 25199 | + 0.5); |
| 25200 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25201 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 25202 | |
| 25203 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 25204 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25205 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_at[6] ) |
| 25206 | + 0.5); |
| 25207 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25208 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 25209 | |
| 25210 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 25211 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25212 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_at[7] ) |
| 25213 | + 0.5); |
| 25214 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25215 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25216 | } |
| 25217 | |
| 25218 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 25219 | can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC], 8, |
| 25220 | &(CAN_Msg[0]), delayTime); |
| 25221 | } |
| 25222 | } |
| 25223 | |
| 25224 | /* End of Outputs for SubSystem: '<S908>/PropB_XPR_FC' */ |
| 25225 | |
| 25226 | /* S-Function (sfix_bitop): '<S901>/Operator' */ |
| 25227 | L4_MABX_B.Operator_lj = (uint8_T)(L4_MABX_B.DataTypeConversion_oh3 & |
| 25228 | L4_MABX_P.Operator_BitMask_b); |
| 25229 | |
| 25230 | /* DataTypeConversion: '<S901>/DataType' */ |
| 25231 | L4_MABX_B.DataType_gf = L4_MABX_B.Operator_lj; |
| 25232 | |
| 25233 | /* ArithShift: '<S881>/Shift_Arithmetic 2' */ |
| 25234 | L4_MABX_B.Shift_Arithmetic2_i = ldexp(L4_MABX_B.DataType_gf, (-3)); |
| 25235 | |
| 25236 | /* DataTypeConversion: '<S881>/Data Type Conversion5' */ |
| 25237 | L4_MABX_B.DataTypeConversion5_c1 = (L4_MABX_B.Shift_Arithmetic2_i != 0.0); |
| 25238 | |
| 25239 | /* Logic: '<S907>/Operator' */ |
| 25240 | L4_MABX_B.Operator_l1 = (L4_MABX_B.TmpRTBAtOperatorInport1_h && |
| 25241 | L4_MABX_B.DataTypeConversion5_c1); |
| 25242 | |
| 25243 | /* DataTypeConversion: '<S907>/DataType' */ |
| 25244 | L4_MABX_B.DataType_ns = L4_MABX_B.Operator_l1; |
| 25245 | |
| 25246 | /* Outputs for Enabled SubSystem: '<S909>/PropB_XPR_FC' incorporates: |
| 25247 | * EnablePort: '<S911>/Enable' |
| 25248 | */ |
| 25249 | if (L4_MABX_B.DataType_ns) { |
| 25250 | /* S-Function (rti_commonblock): '<S911>/S-Function1' */ |
| 25251 | /* This comment workarounds a code generation problem */ |
| 25252 | |
| 25253 | /* dSPACE RTICAN TX Message Block: "PropB_XPR_FC" Id:419366140 */ |
| 25254 | { |
| 25255 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 25256 | |
| 25257 | Float32 delayTime = 0.0; |
| 25258 | |
| 25259 | /* ... Read status and timestamp info (previous message) */ |
| 25260 | can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]); |
| 25261 | |
| 25262 | /* Convert timestamp */ |
| 25263 | if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->processed) { |
| 25264 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->timestamp = |
| 25265 | rtk_dsts_time_to_simtime_convert |
| 25266 | (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->timestamp); |
| 25267 | } |
| 25268 | |
| 25269 | /* Messages with timestamp zero have been received in pause/stop state |
| 25270 | and must not be handled. |
| 25271 | */ |
| 25272 | if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->timestamp > 0.0) { |
| 25273 | L4_MABX_B.SFunction1_o1_ou = (real_T) |
| 25274 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->processed; |
| 25275 | L4_MABX_B.SFunction1_o2_fr = (real_T) |
| 25276 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->timestamp; |
| 25277 | L4_MABX_B.SFunction1_o3_d = (real_T) |
| 25278 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->deltatime; |
| 25279 | L4_MABX_B.SFunction1_o4_bh = (real_T) |
| 25280 | can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->delaytime; |
| 25281 | } |
| 25282 | |
| 25283 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 25284 | { |
| 25285 | rtican_Signal_t CAN_Sgn; |
| 25286 | |
| 25287 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 25288 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25289 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_at[0] ) |
| 25290 | + 0.5); |
| 25291 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25292 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25293 | |
| 25294 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 25295 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25296 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_at[1] ) |
| 25297 | + 0.5); |
| 25298 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25299 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 25300 | |
| 25301 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 25302 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25303 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_at[2] ) |
| 25304 | + 0.5); |
| 25305 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25306 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 25307 | |
| 25308 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 25309 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25310 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_at[3] ) |
| 25311 | + 0.5); |
| 25312 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25313 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 25314 | |
| 25315 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 25316 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25317 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_at[4] ) |
| 25318 | + 0.5); |
| 25319 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25320 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25321 | |
| 25322 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 25323 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25324 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_at[5] ) |
| 25325 | + 0.5); |
| 25326 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25327 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 25328 | |
| 25329 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 25330 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25331 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_at[6] ) |
| 25332 | + 0.5); |
| 25333 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25334 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 25335 | |
| 25336 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 25337 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25338 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_at[7] ) |
| 25339 | + 0.5); |
| 25340 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25341 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25342 | } |
| 25343 | |
| 25344 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 25345 | can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC], 8, |
| 25346 | &(CAN_Msg[0]), delayTime); |
| 25347 | } |
| 25348 | } |
| 25349 | |
| 25350 | /* End of Outputs for SubSystem: '<S909>/PropB_XPR_FC' */ |
| 25351 | |
| 25352 | /* S-Function (sfix_bitop): '<S897>/Operator' */ |
| 25353 | L4_MABX_B.Operator_nn = (uint8_T)(L4_MABX_B.DataTypeConversion_oh3 & |
| 25354 | L4_MABX_P.Operator_BitMask_ac); |
| 25355 | |
| 25356 | /* DataTypeConversion: '<S897>/DataType' */ |
| 25357 | L4_MABX_B.DataType_mk = L4_MABX_B.Operator_nn; |
| 25358 | |
| 25359 | /* S-Function (sfix_bitop): '<S902>/Operator' */ |
| 25360 | L4_MABX_B.Operator_d0 = (uint8_T)(L4_MABX_B.DataTypeConversion_oh3 & |
| 25361 | L4_MABX_P.Operator_BitMask_a3); |
| 25362 | |
| 25363 | /* DataTypeConversion: '<S902>/DataType' */ |
| 25364 | L4_MABX_B.DataType_m0 = L4_MABX_B.Operator_d0; |
| 25365 | |
| 25366 | /* ArithShift: '<S881>/Shift_Arithmetic 3' */ |
| 25367 | L4_MABX_B.Shift_Arithmetic3_l = ldexp(L4_MABX_B.DataType_m0, (-4)); |
| 25368 | |
| 25369 | /* DataTypeConversion: '<S881>/Data Type Conversion6' */ |
| 25370 | L4_MABX_B.DataTypeConversion6_n = (L4_MABX_B.Shift_Arithmetic3_l != 0.0); |
| 25371 | |
| 25372 | /* Logic: '<S898>/Operator' */ |
| 25373 | L4_MABX_B.Operator_k4 = (L4_MABX_B.TmpRTBAtOperatorInport1_k && |
| 25374 | L4_MABX_B.DataTypeConversion6_n); |
| 25375 | |
| 25376 | /* DataTypeConversion: '<S898>/DataType' */ |
| 25377 | L4_MABX_B.DataType_bc0 = L4_MABX_B.Operator_k4; |
| 25378 | |
| 25379 | /* S-Function (sfix_bitop): '<S903>/Operator' */ |
| 25380 | L4_MABX_B.Operator_l4i = (uint8_T)(L4_MABX_B.DataTypeConversion_oh3 & |
| 25381 | L4_MABX_P.Operator_BitMask_ig); |
| 25382 | |
| 25383 | /* DataTypeConversion: '<S903>/DataType' */ |
| 25384 | L4_MABX_B.DataType_kk = L4_MABX_B.Operator_l4i; |
| 25385 | |
| 25386 | /* ArithShift: '<S881>/Shift_Arithmetic 4' */ |
| 25387 | L4_MABX_B.Shift_Arithmetic4_i = ldexp(L4_MABX_B.DataType_kk, (-5)); |
| 25388 | |
| 25389 | /* DataTypeConversion: '<S881>/Data Type Conversion7' */ |
| 25390 | L4_MABX_B.DataTypeConversion7_l = (L4_MABX_B.Shift_Arithmetic4_i != 0.0); |
| 25391 | |
| 25392 | /* Logic: '<S899>/Operator' */ |
| 25393 | L4_MABX_B.Operator_ea = (L4_MABX_B.TmpRTBAtOperatorInport1_a && |
| 25394 | L4_MABX_B.DataTypeConversion7_l); |
| 25395 | |
| 25396 | /* DataTypeConversion: '<S899>/DataType' */ |
| 25397 | L4_MABX_B.DataType_g5 = L4_MABX_B.Operator_ea; |
| 25398 | |
| 25399 | /* S-Function (sfix_bitop): '<S900>/Operator' */ |
| 25400 | L4_MABX_B.Operator_ci = (uint8_T)(L4_MABX_B.DataTypeConversion_oh3 & |
| 25401 | L4_MABX_P.Operator_BitMask_cy); |
| 25402 | |
| 25403 | /* DataTypeConversion: '<S900>/DataType' */ |
| 25404 | L4_MABX_B.DataType_nd = L4_MABX_B.Operator_ci; |
| 25405 | |
| 25406 | /* ArithShift: '<S881>/Shift_Arithmetic ' */ |
| 25407 | L4_MABX_B.Shift_Arithmetic_c = ldexp(L4_MABX_B.DataType_mk, (-1)); |
| 25408 | |
| 25409 | /* DataTypeConversion: '<S881>/Data Type Conversion3' */ |
| 25410 | L4_MABX_B.DataTypeConversion3_ed = (L4_MABX_B.Shift_Arithmetic_c != 0.0); |
| 25411 | |
| 25412 | /* Logic: '<S905>/Operator' */ |
| 25413 | L4_MABX_B.Operator_ayv = (L4_MABX_B.TmpRTBAtOperatorInport1_j && |
| 25414 | L4_MABX_B.DataTypeConversion3_ed); |
| 25415 | |
| 25416 | /* DataTypeConversion: '<S905>/DataType' */ |
| 25417 | L4_MABX_B.DataType_hn = L4_MABX_B.Operator_ayv; |
| 25418 | |
| 25419 | /* ArithShift: '<S881>/Shift_Arithmetic 1' */ |
| 25420 | L4_MABX_B.Shift_Arithmetic1_iq = ldexp(L4_MABX_B.DataType_nd, (-2)); |
| 25421 | |
| 25422 | /* DataTypeConversion: '<S881>/Data Type Conversion4' */ |
| 25423 | L4_MABX_B.DataTypeConversion4_e4 = (L4_MABX_B.Shift_Arithmetic1_iq != 0.0); |
| 25424 | |
| 25425 | /* Logic: '<S906>/Operator' */ |
| 25426 | L4_MABX_B.Operator_pl = (L4_MABX_B.TmpRTBAtOperatorInport1_b && |
| 25427 | L4_MABX_B.DataTypeConversion4_e4); |
| 25428 | |
| 25429 | /* DataTypeConversion: '<S906>/DataType' */ |
| 25430 | L4_MABX_B.DataType_ir = L4_MABX_B.Operator_pl; |
| 25431 | |
| 25432 | /* DataTypeConversion: '<S938>/Data Type Conversion' */ |
| 25433 | L4_MABX_B.DataTypeConversion_l = L4_MABX_B.Latitude__g; |
| 25434 | |
| 25435 | /* DataTypeConversion: '<S938>/Data Type Conversion1' */ |
| 25436 | L4_MABX_B.DataTypeConversion1_pl = L4_MABX_B.Longitude__p; |
| 25437 | |
| 25438 | /* DataTypeConversion: '<S887>/Data Type Conversion2' incorporates: |
| 25439 | * Constant: '<S853>/enablePosRapidUpdateTX' |
| 25440 | */ |
| 25441 | L4_MABX_B.DataTypeConversion2_p1 = L4_MABX_P.enablePosRapidUpdateTX_Value; |
| 25442 | |
| 25443 | /* Outputs for Enabled SubSystem: '<S938>/Std_PosRapidUpdate_01' incorporates: |
| 25444 | * EnablePort: '<S939>/Enable' |
| 25445 | */ |
| 25446 | if (L4_MABX_B.DataTypeConversion2_p1) { |
| 25447 | /* S-Function (rti_commonblock): '<S939>/S-Function1' */ |
| 25448 | /* This comment workarounds a code generation problem */ |
| 25449 | |
| 25450 | /* dSPACE RTICAN TX Message Block: "Std_PosRapidUpdate_01" Id:3 */ |
| 25451 | { |
| 25452 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 25453 | |
| 25454 | Float32 delayTime = 0.0; |
| 25455 | |
| 25456 | /* ... Read status and timestamp info (previous message) */ |
| 25457 | can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]); |
| 25458 | |
| 25459 | /* Convert timestamp */ |
| 25460 | if (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->processed) { |
| 25461 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->timestamp = |
| 25462 | rtk_dsts_time_to_simtime_convert |
| 25463 | (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->timestamp); |
| 25464 | } |
| 25465 | |
| 25466 | /* Messages with timestamp zero have been received in pause/stop state |
| 25467 | and must not be handled. |
| 25468 | */ |
| 25469 | if (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->timestamp > 0.0) { |
| 25470 | L4_MABX_B.SFunction1_o1_d = (real_T) |
| 25471 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->processed; |
| 25472 | L4_MABX_B.SFunction1_o2_om = (real_T) |
| 25473 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->timestamp; |
| 25474 | L4_MABX_B.SFunction1_o3_ks = (real_T) |
| 25475 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->deltatime; |
| 25476 | L4_MABX_B.SFunction1_o4_ip = (real_T) |
| 25477 | can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->delaytime; |
| 25478 | } |
| 25479 | |
| 25480 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 25481 | { |
| 25482 | rtican_Signal_t CAN_Sgn; |
| 25483 | |
| 25484 | /* ...... "Latitude_" (0|32, standard signal, signed int, little endian) */ |
| 25485 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25486 | if (( L4_MABX_B.DataTypeConversion_l - ( 0 ) ) / 1.0E-7 < -0.5) |
| 25487 | CAN_Sgn.SignedSgn = (Int32) (( L4_MABX_B.DataTypeConversion_l - ( 0 ) ) |
| 25488 | / 1.0E-7 - 0.5); |
| 25489 | else |
| 25490 | CAN_Sgn.SignedSgn = (Int32) (( L4_MABX_B.DataTypeConversion_l - ( 0 ) ) |
| 25491 | / 1.0E-7 + 0.5); |
| 25492 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25493 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte1; |
| 25494 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte2; |
| 25495 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte3; |
| 25496 | |
| 25497 | /* ...... "Longitude_" (32|32, standard signal, signed int, little endian) */ |
| 25498 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25499 | if (( L4_MABX_B.DataTypeConversion1_pl - ( 0 ) ) / 1.0E-7 < -0.5) |
| 25500 | CAN_Sgn.SignedSgn = (Int32) (( L4_MABX_B.DataTypeConversion1_pl - ( 0 ) |
| 25501 | ) / 1.0E-7 - 0.5); |
| 25502 | else |
| 25503 | CAN_Sgn.SignedSgn = (Int32) (( L4_MABX_B.DataTypeConversion1_pl - ( 0 ) |
| 25504 | ) / 1.0E-7 + 0.5); |
| 25505 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25506 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte1; |
| 25507 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte2; |
| 25508 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte3; |
| 25509 | } |
| 25510 | |
| 25511 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 25512 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3], 8, &(CAN_Msg[0]), |
| 25513 | delayTime); |
| 25514 | } |
| 25515 | } |
| 25516 | |
| 25517 | /* End of Outputs for SubSystem: '<S938>/Std_PosRapidUpdate_01' */ |
| 25518 | |
| 25519 | /* Outputs for Enabled SubSystem: '<S889>/CCVS1_00' incorporates: |
| 25520 | * EnablePort: '<S891>/Enable' |
| 25521 | */ |
| 25522 | /* Outputs for Enabled SubSystem: '<S888>/CCVS1_00' incorporates: |
| 25523 | * EnablePort: '<S890>/Enable' |
| 25524 | */ |
| 25525 | /* Constant: '<S879>/Enable_TX_CCVS1_00' */ |
| 25526 | if (L4_MABX_P.Enable_TX_CCVS1_00_Value) { |
| 25527 | /* S-Function (rti_commonblock): '<S890>/S-Function1' */ |
| 25528 | /* This comment workarounds a code generation problem */ |
| 25529 | |
| 25530 | /* dSPACE RTICAN TX Message Block: "CCVS1_00" Id:419361024 */ |
| 25531 | { |
| 25532 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 25533 | |
| 25534 | Float32 delayTime = 0.0; |
| 25535 | |
| 25536 | /* ... Read status and timestamp info (previous message) */ |
| 25537 | can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]); |
| 25538 | |
| 25539 | /* Convert timestamp */ |
| 25540 | if (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->processed) { |
| 25541 | can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->timestamp = |
| 25542 | rtk_dsts_time_to_simtime_convert |
| 25543 | (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->timestamp); |
| 25544 | } |
| 25545 | |
| 25546 | /* Messages with timestamp zero have been received in pause/stop state |
| 25547 | and must not be handled. |
| 25548 | */ |
| 25549 | if (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->timestamp > 0.0) { |
| 25550 | L4_MABX_B.SFunction1_o1_g = (real_T) |
| 25551 | can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->processed; |
| 25552 | L4_MABX_B.SFunction1_o2_hx = (real_T) |
| 25553 | can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->timestamp; |
| 25554 | L4_MABX_B.SFunction1_o3_ae = (real_T) |
| 25555 | can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->deltatime; |
| 25556 | L4_MABX_B.SFunction1_o4_ay = (real_T) |
| 25557 | can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->delaytime; |
| 25558 | } |
| 25559 | |
| 25560 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 25561 | { |
| 25562 | rtican_Signal_t CAN_Sgn; |
| 25563 | |
| 25564 | /* ...... "TwoSpeedAxleSwitch" (0|2, standard signal, unsigned int, little endian) */ |
| 25565 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25566 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.TwoSpeedAxleSwitch_n ) + 0.5); |
| 25567 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25568 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25569 | |
| 25570 | /* ...... "ParkingBrakeSwitch" (2|2, standard signal, unsigned int, little endian) */ |
| 25571 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25572 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkingBrakeSwitch_p ) + 0.5); |
| 25573 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25574 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 25575 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25576 | |
| 25577 | /* ...... "CruiseCtrlPauseSwitch" (4|2, standard signal, unsigned int, little endian) */ |
| 25578 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25579 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlPauseSwitch_o ) + |
| 25580 | 0.5); |
| 25581 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25582 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 25583 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25584 | |
| 25585 | /* ...... "ParkBrakeReleaseInhibitRq" (6|2, standard signal, unsigned int, little endian) */ |
| 25586 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25587 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkBrakeReleaseInhibitRq_l ) |
| 25588 | + 0.5); |
| 25589 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25590 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 25591 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25592 | |
| 25593 | /* ...... "WheelBasedVehicleSpeed" (8|16, standard signal, unsigned int, little endian) */ |
| 25594 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25595 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.WheelBasedVehicleSpeed_hl - |
| 25596 | ( 0 ) ) / 0.00390625 + 0.5); |
| 25597 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 25598 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 25599 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte1; |
| 25600 | |
| 25601 | /* ...... "CruiseCtrlActive" (24|2, standard signal, unsigned int, little endian) */ |
| 25602 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25603 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlActive_l ) + 0.5); |
| 25604 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25605 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 25606 | |
| 25607 | /* ...... "CruiseCtrlEnableSwitch" (26|2, standard signal, unsigned int, little endian) */ |
| 25608 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25609 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlEnableSwitch_nw ) |
| 25610 | + 0.5); |
| 25611 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25612 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 25613 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 25614 | |
| 25615 | /* ...... "BrakeSwitch" (28|2, standard signal, unsigned int, little endian) */ |
| 25616 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25617 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.BrakeSwitch_im ) + 0.5); |
| 25618 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25619 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 25620 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 25621 | |
| 25622 | /* ...... "ClutchSwitch" (30|2, standard signal, unsigned int, little endian) */ |
| 25623 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25624 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ClutchSwitch_a ) + 0.5); |
| 25625 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25626 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 25627 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 25628 | |
| 25629 | /* ...... "CruiseCtrlSetSwitch" (32|2, standard signal, unsigned int, little endian) */ |
| 25630 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25631 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSwitch_h ) + |
| 25632 | 0.5); |
| 25633 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25634 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25635 | |
| 25636 | /* ...... "CruiseCtrlCoastSwitch" (34|2, standard signal, unsigned int, little endian) */ |
| 25637 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25638 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlCoastSwitch_b ) + |
| 25639 | 0.5); |
| 25640 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25641 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 25642 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25643 | |
| 25644 | /* ...... "CruiseCtrlResumeSwitch" (36|2, standard signal, unsigned int, little endian) */ |
| 25645 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25646 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlResumeSwitch_j ) + |
| 25647 | 0.5); |
| 25648 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25649 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 25650 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25651 | |
| 25652 | /* ...... "CruiseCtrlAccelerateSwitch" (38|2, standard signal, unsigned int, little endian) */ |
| 25653 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25654 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlAccelerateSwitch_h |
| 25655 | ) + 0.5); |
| 25656 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25657 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 25658 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25659 | |
| 25660 | /* ...... "CruiseCtrlSetSpeed" (40|8, standard signal, unsigned int, little endian) */ |
| 25661 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25662 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSpeed_o ) + 0.5); |
| 25663 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25664 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 25665 | |
| 25666 | /* ...... "PTOGovernorState" (48|5, standard signal, unsigned int, little endian) */ |
| 25667 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25668 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.PTOGovernorState_g ) + 0.5); |
| 25669 | CAN_Sgn.UnsignedSgn &= 0x0000001F; |
| 25670 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 25671 | |
| 25672 | /* ...... "CruiseCtrlStates" (53|3, standard signal, unsigned int, little endian) */ |
| 25673 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25674 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlStates_a ) + 0.5); |
| 25675 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 25676 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 5; |
| 25677 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 25678 | |
| 25679 | /* ...... "EngIdleIncrementSwitch" (56|2, standard signal, unsigned int, little endian) */ |
| 25680 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25681 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleIncrementSwitch_j ) + |
| 25682 | 0.5); |
| 25683 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25684 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25685 | |
| 25686 | /* ...... "EngIdleDecrementSwitch" (58|2, standard signal, unsigned int, little endian) */ |
| 25687 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25688 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleDecrementSwitch_j ) + |
| 25689 | 0.5); |
| 25690 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25691 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 25692 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25693 | |
| 25694 | /* ...... "EngTestModeSwitch" (60|2, standard signal, unsigned int, little endian) */ |
| 25695 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25696 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngTestModeSwitch_e ) + 0.5); |
| 25697 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25698 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 25699 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25700 | |
| 25701 | /* ...... "EngShutdownOverrideSwitch" (62|2, standard signal, unsigned int, little endian) */ |
| 25702 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25703 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngShutdownOverrideSwitch_l ) |
| 25704 | + 0.5); |
| 25705 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25706 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 25707 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25708 | } |
| 25709 | |
| 25710 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 25711 | can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100], 8, |
| 25712 | &(CAN_Msg[0]), delayTime); |
| 25713 | } |
| 25714 | |
| 25715 | /* S-Function (rti_commonblock): '<S891>/S-Function1' */ |
| 25716 | /* This comment workarounds a code generation problem */ |
| 25717 | |
| 25718 | /* dSPACE RTICAN TX Message Block: "CCVS1_00" Id:218034432 */ |
| 25719 | { |
| 25720 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 25721 | |
| 25722 | Float32 delayTime = 0.0; |
| 25723 | |
| 25724 | /* ... Read status and timestamp info (previous message) */ |
| 25725 | can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]); |
| 25726 | |
| 25727 | /* Convert timestamp */ |
| 25728 | if (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->processed) { |
| 25729 | can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->timestamp = |
| 25730 | rtk_dsts_time_to_simtime_convert |
| 25731 | (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->timestamp); |
| 25732 | } |
| 25733 | |
| 25734 | /* Messages with timestamp zero have been received in pause/stop state |
| 25735 | and must not be handled. |
| 25736 | */ |
| 25737 | if (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->timestamp > 0.0) { |
| 25738 | L4_MABX_B.SFunction1_o1_b2 = (real_T) |
| 25739 | can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->processed; |
| 25740 | L4_MABX_B.SFunction1_o2_ht = (real_T) |
| 25741 | can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->timestamp; |
| 25742 | L4_MABX_B.SFunction1_o3_a = (real_T) |
| 25743 | can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->deltatime; |
| 25744 | L4_MABX_B.SFunction1_o4_dk = (real_T) |
| 25745 | can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->delaytime; |
| 25746 | } |
| 25747 | |
| 25748 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 25749 | { |
| 25750 | rtican_Signal_t CAN_Sgn; |
| 25751 | |
| 25752 | /* ...... "TwoSpeedAxleSwitch" (0|2, standard signal, unsigned int, little endian) */ |
| 25753 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25754 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.TwoSpeedAxleSwitch_nr ) + |
| 25755 | 0.5); |
| 25756 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25757 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25758 | |
| 25759 | /* ...... "ParkingBrakeSwitch" (2|2, standard signal, unsigned int, little endian) */ |
| 25760 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25761 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkingBrakeSwitch_pk ) + |
| 25762 | 0.5); |
| 25763 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25764 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 25765 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25766 | |
| 25767 | /* ...... "CruiseCtrlPauseSwitch" (4|2, standard signal, unsigned int, little endian) */ |
| 25768 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25769 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlPauseSwitch_oq ) + |
| 25770 | 0.5); |
| 25771 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25772 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 25773 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25774 | |
| 25775 | /* ...... "ParkBrakeReleaseInhibitRq" (6|2, standard signal, unsigned int, little endian) */ |
| 25776 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25777 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkBrakeReleaseInhibitRq_lm |
| 25778 | ) + 0.5); |
| 25779 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25780 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 25781 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 25782 | |
| 25783 | /* ...... "WheelBasedVehicleSpeed" (8|16, standard signal, unsigned int, little endian) */ |
| 25784 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25785 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.WheelBasedVehicleSpeed_hln - |
| 25786 | ( 0 ) ) / 0.00390625 + 0.5); |
| 25787 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 25788 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 25789 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte1; |
| 25790 | |
| 25791 | /* ...... "CruiseCtrlActive" (24|2, standard signal, unsigned int, little endian) */ |
| 25792 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25793 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlActive_lh ) + 0.5); |
| 25794 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25795 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 25796 | |
| 25797 | /* ...... "CruiseCtrlEnableSwitch" (26|2, standard signal, unsigned int, little endian) */ |
| 25798 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25799 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlEnableSwitch_nwy ) |
| 25800 | + 0.5); |
| 25801 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25802 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 25803 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 25804 | |
| 25805 | /* ...... "BrakeSwitch" (28|2, standard signal, unsigned int, little endian) */ |
| 25806 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25807 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.BrakeSwitch_imh ) + 0.5); |
| 25808 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25809 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 25810 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 25811 | |
| 25812 | /* ...... "ClutchSwitch" (30|2, standard signal, unsigned int, little endian) */ |
| 25813 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25814 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ClutchSwitch_ae ) + 0.5); |
| 25815 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25816 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 25817 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 25818 | |
| 25819 | /* ...... "CruiseCtrlSetSwitch" (32|2, standard signal, unsigned int, little endian) */ |
| 25820 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25821 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSwitch_hr ) + |
| 25822 | 0.5); |
| 25823 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25824 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25825 | |
| 25826 | /* ...... "CruiseCtrlCoastSwitch" (34|2, standard signal, unsigned int, little endian) */ |
| 25827 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25828 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlCoastSwitch_bg ) + |
| 25829 | 0.5); |
| 25830 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25831 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 25832 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25833 | |
| 25834 | /* ...... "CruiseCtrlResumeSwitch" (36|2, standard signal, unsigned int, little endian) */ |
| 25835 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25836 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlResumeSwitch_j2 ) |
| 25837 | + 0.5); |
| 25838 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25839 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 25840 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25841 | |
| 25842 | /* ...... "CruiseCtrlAccelerateSwitch" (38|2, standard signal, unsigned int, little endian) */ |
| 25843 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25844 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 25845 | (( L4_MABX_B.CruiseCtrlAccelerateSwitch_h1 ) + 0.5); |
| 25846 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25847 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 25848 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 25849 | |
| 25850 | /* ...... "CruiseCtrlSetSpeed" (40|8, standard signal, unsigned int, little endian) */ |
| 25851 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25852 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSpeed_o0 ) + |
| 25853 | 0.5); |
| 25854 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 25855 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 25856 | |
| 25857 | /* ...... "PTOGovernorState" (48|5, standard signal, unsigned int, little endian) */ |
| 25858 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25859 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.PTOGovernorState_gd ) + 0.5); |
| 25860 | CAN_Sgn.UnsignedSgn &= 0x0000001F; |
| 25861 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 25862 | |
| 25863 | /* ...... "CruiseCtrlStates" (53|3, standard signal, unsigned int, little endian) */ |
| 25864 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25865 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlStates_ah ) + 0.5); |
| 25866 | CAN_Sgn.UnsignedSgn &= 0x00000007; |
| 25867 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 5; |
| 25868 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 25869 | |
| 25870 | /* ...... "EngIdleIncrementSwitch" (56|2, standard signal, unsigned int, little endian) */ |
| 25871 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25872 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleIncrementSwitch_jk ) |
| 25873 | + 0.5); |
| 25874 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25875 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25876 | |
| 25877 | /* ...... "EngIdleDecrementSwitch" (58|2, standard signal, unsigned int, little endian) */ |
| 25878 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25879 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleDecrementSwitch_j2 ) |
| 25880 | + 0.5); |
| 25881 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25882 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 25883 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25884 | |
| 25885 | /* ...... "EngTestModeSwitch" (60|2, standard signal, unsigned int, little endian) */ |
| 25886 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25887 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngTestModeSwitch_em ) + 0.5); |
| 25888 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25889 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 25890 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25891 | |
| 25892 | /* ...... "EngShutdownOverrideSwitch" (62|2, standard signal, unsigned int, little endian) */ |
| 25893 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 25894 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngShutdownOverrideSwitch_lp |
| 25895 | ) + 0.5); |
| 25896 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 25897 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 25898 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 25899 | } |
| 25900 | |
| 25901 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 25902 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100], 8, |
| 25903 | &(CAN_Msg[0]), delayTime); |
| 25904 | } |
| 25905 | } |
| 25906 | |
| 25907 | /* End of Constant: '<S879>/Enable_TX_CCVS1_00' */ |
| 25908 | /* End of Outputs for SubSystem: '<S888>/CCVS1_00' */ |
| 25909 | /* End of Outputs for SubSystem: '<S889>/CCVS1_00' */ |
| 25910 | |
| 25911 | /* DataTypeConversion: '<S885>/Data Type Conversion' incorporates: |
| 25912 | * Constant: '<S884>/Constant' |
| 25913 | */ |
| 25914 | L4_MABX_B.DataTypeConversion_lo = L4_MABX_P.Constant_Value_ge; |
| 25915 | |
| 25916 | /* DataTypeConversion: '<S885>/Data Type Conversion1' */ |
| 25917 | L4_MABX_B.DataTypeConversion1_j4 = (uint16_T)L4_MABX_B.DataTypeConversion_lo; |
| 25918 | |
| 25919 | /* S-Function (sfix_bitop): '<S916>/Operator' */ |
| 25920 | L4_MABX_B.Operator_mk = (uint16_T)(L4_MABX_B.DataTypeConversion1_j4 & |
| 25921 | L4_MABX_P.Operator_BitMask_p5); |
| 25922 | |
| 25923 | /* DataTypeConversion: '<S916>/DataType' */ |
| 25924 | tmp = L4_MABX_B.Operator_mk; |
| 25925 | if (tmp > 255) { |
| 25926 | tmp = 255U; |
| 25927 | } |
| 25928 | |
| 25929 | L4_MABX_B.DataType_m3 = (uint8_T)tmp; |
| 25930 | |
| 25931 | /* End of DataTypeConversion: '<S916>/DataType' */ |
| 25932 | |
| 25933 | /* S-Function (sfix_bitop): '<S917>/Operator' */ |
| 25934 | L4_MABX_B.Operator_nj = (uint16_T)(L4_MABX_B.DataTypeConversion1_j4 & |
| 25935 | L4_MABX_P.Operator_BitMask_bd); |
| 25936 | |
| 25937 | /* DataTypeConversion: '<S917>/DataType' */ |
| 25938 | L4_MABX_B.DataType_mf = L4_MABX_B.Operator_nj; |
| 25939 | |
| 25940 | /* ArithShift: '<S885>/Shift_Arithmetic ' */ |
| 25941 | L4_MABX_B.Shift_Arithmetic_co = (uint16_T)((uint32_T)L4_MABX_B.DataType_mf >> |
| 25942 | 8); |
| 25943 | |
| 25944 | /* DataTypeConversion: '<S885>/Data Type Conversion2' */ |
| 25945 | tmp = L4_MABX_B.Shift_Arithmetic_co; |
| 25946 | if (tmp > 255) { |
| 25947 | tmp = 255U; |
| 25948 | } |
| 25949 | |
| 25950 | L4_MABX_B.DataTypeConversion2_os = (uint8_T)tmp; |
| 25951 | |
| 25952 | /* End of DataTypeConversion: '<S885>/Data Type Conversion2' */ |
| 25953 | |
| 25954 | /* DataTypeConversion: '<S880>/Data Type Conversion1' incorporates: |
| 25955 | * Constant: '<S885>/Constant' |
| 25956 | */ |
| 25957 | L4_MABX_B.DataTypeConversion1_f[0] = L4_MABX_P.Constant_Value_jh; |
| 25958 | L4_MABX_B.DataTypeConversion1_f[1] = L4_MABX_P.Constant_Value_jh; |
| 25959 | L4_MABX_B.DataTypeConversion1_f[2] = L4_MABX_P.Constant_Value_jh; |
| 25960 | L4_MABX_B.DataTypeConversion1_f[3] = L4_MABX_P.Constant_Value_jh; |
| 25961 | L4_MABX_B.DataTypeConversion1_f[4] = L4_MABX_P.Constant_Value_jh; |
| 25962 | L4_MABX_B.DataTypeConversion1_f[5] = L4_MABX_P.Constant_Value_jh; |
| 25963 | L4_MABX_B.DataTypeConversion1_f[6] = L4_MABX_B.DataType_m3; |
| 25964 | L4_MABX_B.DataTypeConversion1_f[7] = L4_MABX_B.DataTypeConversion2_os; |
| 25965 | |
| 25966 | /* RateTransition: '<S892>/TmpRTBAtHiddenBuf_InsertedFor_PropB_REAX_5_E4_at_inport_10Inport1' */ |
| 25967 | L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_P = L4_MABX_B.Operator_bx; |
| 25968 | |
| 25969 | /* Outputs for Enabled SubSystem: '<S892>/PropB_REAX_5_E4' incorporates: |
| 25970 | * EnablePort: '<S894>/Enable' |
| 25971 | */ |
| 25972 | if (L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_P) { |
| 25973 | /* S-Function (rti_commonblock): '<S894>/S-Function1' incorporates: |
| 25974 | * Constant: '<S892>/Constant' |
| 25975 | * Constant: '<S892>/Constant1' |
| 25976 | */ |
| 25977 | /* This comment workarounds a code generation problem */ |
| 25978 | |
| 25979 | /* dSPACE RTICAN TX Message Block: "PropB_REAX_5_E4" Id:419429092 */ |
| 25980 | { |
| 25981 | static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 25982 | 0x00 }; |
| 25983 | |
| 25984 | Float32 delayTime = 0.0; |
| 25985 | |
| 25986 | /* link this pointer to CAN_Msg for use in initialize_io_units() */ |
| 25987 | CANTP1_PTR_M1_C2_XTD_0x18FFFAE4 = &(CAN_Msg[0]); |
| 25988 | |
| 25989 | /* ... perform loop-back if required */ |
| 25990 | if (L4_MABX_P.Constant1_Value_ng > 0.5) { |
| 25991 | /* ... updating the used tx-clientbuffer */ |
| 25992 | can_tp1_msg_update_all( CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->module, |
| 25993 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->queue ); |
| 25994 | |
| 25995 | /* ... Read status and timestamp info perform loop-back (previous message) */ |
| 25996 | can_tp1_tx_msg_read_loopback(CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4, |
| 25997 | 8, // datalen |
| 25998 | &(CAN_Msg[0]), |
| 25999 | CANTP1_RX_SPMSG_M1_C2_XTD); |
| 26000 | |
| 26001 | /* Convert timestamp */ |
| 26002 | if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->processed) { |
| 26003 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp = |
| 26004 | rtk_dsts_time_to_simtime_convert |
| 26005 | (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp); |
| 26006 | } |
| 26007 | } else { |
| 26008 | /* ... Read status and timestamp info (previous message) */ |
| 26009 | can_tp1_msg_read_from_dsmcr(CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4); |
| 26010 | |
| 26011 | /* Convert timestamp */ |
| 26012 | if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->processed) { |
| 26013 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp = |
| 26014 | rtk_dsts_time_to_simtime_convert |
| 26015 | (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp); |
| 26016 | } |
| 26017 | } |
| 26018 | |
| 26019 | /* Messages with timestamp zero have been received in pause/stop state |
| 26020 | and must not be handled. |
| 26021 | */ |
| 26022 | if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp > 0.0) { |
| 26023 | L4_MABX_B.SFunction1_o1_f2 = (real_T) |
| 26024 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->processed; |
| 26025 | L4_MABX_B.SFunction1_o2_h3 = (real_T) |
| 26026 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp; |
| 26027 | L4_MABX_B.SFunction1_o3_ff = (real_T) |
| 26028 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->deltatime; |
| 26029 | L4_MABX_B.SFunction1_o4_eo = (real_T) |
| 26030 | CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->delaytime; |
| 26031 | } |
| 26032 | |
| 26033 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 26034 | { |
| 26035 | rtican_Signal_t CAN_Sgn; |
| 26036 | UInt32 i; |
| 26037 | |
| 26038 | /* Initialize the static message data to zero */ |
| 26039 | for (i=0; i<8; i++ ) |
| 26040 | CAN_Msg[i] = 0; |
| 26041 | |
| 26042 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 26043 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26044 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f[0] ) + |
| 26045 | 0.5); |
| 26046 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26047 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26048 | |
| 26049 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 26050 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26051 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f[1] ) + |
| 26052 | 0.5); |
| 26053 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26054 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 26055 | |
| 26056 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 26057 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26058 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f[2] ) + |
| 26059 | 0.5); |
| 26060 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26061 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 26062 | |
| 26063 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 26064 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26065 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f[3] ) + |
| 26066 | 0.5); |
| 26067 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26068 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 26069 | |
| 26070 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 26071 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26072 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f[4] ) + |
| 26073 | 0.5); |
| 26074 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26075 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 26076 | |
| 26077 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 26078 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26079 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f[5] ) + |
| 26080 | 0.5); |
| 26081 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26082 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 26083 | |
| 26084 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 26085 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26086 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f[6] ) + |
| 26087 | 0.5); |
| 26088 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26089 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 26090 | |
| 26091 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 26092 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26093 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f[7] ) + |
| 26094 | 0.5); |
| 26095 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26096 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26097 | } |
| 26098 | |
| 26099 | delayTime = (Float32) L4_MABX_P.Constant_Value_pj / (1700); |
| 26100 | |
| 26101 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 26102 | can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FFFAE4], 8, |
| 26103 | &(CAN_Msg[0]), delayTime); |
| 26104 | } |
| 26105 | } |
| 26106 | |
| 26107 | /* End of Outputs for SubSystem: '<S892>/PropB_REAX_5_E4' */ |
| 26108 | |
| 26109 | /* RateTransition: '<S893>/TmpRTBAtHiddenBuf_InsertedFor_PropB_REAX_5_E4_at_inport_10Inport1' */ |
| 26110 | L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_m = L4_MABX_B.EnablePropB_ReAX_CAN6; |
| 26111 | |
| 26112 | /* Outputs for Enabled SubSystem: '<S893>/PropB_REAX_5_E4' incorporates: |
| 26113 | * EnablePort: '<S895>/Enable' |
| 26114 | */ |
| 26115 | if (L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_m) { |
| 26116 | /* S-Function (rti_commonblock): '<S895>/S-Function1' incorporates: |
| 26117 | * Constant: '<S893>/Constant' |
| 26118 | * Constant: '<S893>/Constant1' |
| 26119 | */ |
| 26120 | /* This comment workarounds a code generation problem */ |
| 26121 | |
| 26122 | /* dSPACE RTICAN TX Message Block: "PropB_REAX_5_E4" Id:419429092 */ |
| 26123 | { |
| 26124 | static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 26125 | 0x00 }; |
| 26126 | |
| 26127 | Float32 delayTime = 0.0; |
| 26128 | |
| 26129 | /* link this pointer to CAN_Msg for use in initialize_io_units() */ |
| 26130 | CANTP1_PTR_M3_C2_XTD_0x18FFFAE4 = &(CAN_Msg[0]); |
| 26131 | |
| 26132 | /* ... perform loop-back if required */ |
| 26133 | if (L4_MABX_P.Constant1_Value_gc > 0.5) { |
| 26134 | /* ... updating the used tx-clientbuffer */ |
| 26135 | can_tp1_msg_update_all( CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->module, |
| 26136 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->queue ); |
| 26137 | |
| 26138 | /* ... Read status and timestamp info perform loop-back (previous message) */ |
| 26139 | can_tp1_tx_msg_read_loopback(CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4, |
| 26140 | 8, // datalen |
| 26141 | &(CAN_Msg[0]), |
| 26142 | CANTP1_RX_SPMSG_M3_C2_XTD); |
| 26143 | |
| 26144 | /* Convert timestamp */ |
| 26145 | if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->processed) { |
| 26146 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp = |
| 26147 | rtk_dsts_time_to_simtime_convert |
| 26148 | (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp); |
| 26149 | } |
| 26150 | } else { |
| 26151 | /* ... Read status and timestamp info (previous message) */ |
| 26152 | can_tp1_msg_read_from_dsmcr(CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4); |
| 26153 | |
| 26154 | /* Convert timestamp */ |
| 26155 | if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->processed) { |
| 26156 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp = |
| 26157 | rtk_dsts_time_to_simtime_convert |
| 26158 | (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp); |
| 26159 | } |
| 26160 | } |
| 26161 | |
| 26162 | /* Messages with timestamp zero have been received in pause/stop state |
| 26163 | and must not be handled. |
| 26164 | */ |
| 26165 | if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp > 0.0) { |
| 26166 | L4_MABX_B.SFunction1_o1_ah = (real_T) |
| 26167 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->processed; |
| 26168 | L4_MABX_B.SFunction1_o2_hw = (real_T) |
| 26169 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp; |
| 26170 | L4_MABX_B.SFunction1_o3_c = (real_T) |
| 26171 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->deltatime; |
| 26172 | L4_MABX_B.SFunction1_o4_d0 = (real_T) |
| 26173 | CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->delaytime; |
| 26174 | } |
| 26175 | |
| 26176 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 26177 | { |
| 26178 | rtican_Signal_t CAN_Sgn; |
| 26179 | UInt32 i; |
| 26180 | |
| 26181 | /* Initialize the static message data to zero */ |
| 26182 | for (i=0; i<8; i++ ) |
| 26183 | CAN_Msg[i] = 0; |
| 26184 | |
| 26185 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 26186 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26187 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f[0] ) + |
| 26188 | 0.5); |
| 26189 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26190 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26191 | |
| 26192 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 26193 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26194 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f[1] ) + |
| 26195 | 0.5); |
| 26196 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26197 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 26198 | |
| 26199 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 26200 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26201 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f[2] ) + |
| 26202 | 0.5); |
| 26203 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26204 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 26205 | |
| 26206 | /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */ |
| 26207 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26208 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f[3] ) + |
| 26209 | 0.5); |
| 26210 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26211 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 26212 | |
| 26213 | /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */ |
| 26214 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26215 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f[4] ) + |
| 26216 | 0.5); |
| 26217 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26218 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 26219 | |
| 26220 | /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */ |
| 26221 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26222 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f[5] ) + |
| 26223 | 0.5); |
| 26224 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26225 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 26226 | |
| 26227 | /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */ |
| 26228 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26229 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f[6] ) + |
| 26230 | 0.5); |
| 26231 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26232 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 26233 | |
| 26234 | /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */ |
| 26235 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26236 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_f[7] ) + |
| 26237 | 0.5); |
| 26238 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26239 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26240 | } |
| 26241 | |
| 26242 | delayTime = (Float32) L4_MABX_P.Constant_Value_ke / (1700); |
| 26243 | |
| 26244 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 26245 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0X18FFFAE4], 8, |
| 26246 | &(CAN_Msg[0]), delayTime); |
| 26247 | } |
| 26248 | } |
| 26249 | |
| 26250 | /* End of Outputs for SubSystem: '<S893>/PropB_REAX_5_E4' */ |
| 26251 | |
| 26252 | /* DataTypeConversion: '<S912>/Data Type Conversion' */ |
| 26253 | L4_MABX_B.DataTypeConversion_bu = L4_MABX_B.SID_lz; |
| 26254 | |
| 26255 | /* DataTypeConversion: '<S912>/Data Type Conversion1' */ |
| 26256 | L4_MABX_B.DataTypeConversion1_m = L4_MABX_B.COGReference_e; |
| 26257 | |
| 26258 | /* DataTypeConversion: '<S912>/Data Type Conversion2' */ |
| 26259 | L4_MABX_B.DataTypeConversion2_ji = L4_MABX_B.CourseOverGround_p; |
| 26260 | |
| 26261 | /* DataTypeConversion: '<S912>/Data Type Conversion3' */ |
| 26262 | L4_MABX_B.DataTypeConversion3_p = L4_MABX_B.SpeedOverGround_a; |
| 26263 | |
| 26264 | /* DataTypeConversion: '<S882>/Data Type Conversion2' incorporates: |
| 26265 | * Constant: '<S853>/enableCOGSRapidUpdateTX' |
| 26266 | */ |
| 26267 | L4_MABX_B.DataTypeConversion2_l1i = L4_MABX_P.enableCOGSRapidUpdateTX_Value; |
| 26268 | |
| 26269 | /* Outputs for Enabled SubSystem: '<S912>/Std_COGSOGRapidUpdate_01' incorporates: |
| 26270 | * EnablePort: '<S913>/Enable' |
| 26271 | */ |
| 26272 | if (L4_MABX_B.DataTypeConversion2_l1i) { |
| 26273 | /* S-Function (rti_commonblock): '<S913>/S-Function1' incorporates: |
| 26274 | * Constant: '<S912>/Constant' |
| 26275 | * Constant: '<S912>/Constant1' |
| 26276 | */ |
| 26277 | /* This comment workarounds a code generation problem */ |
| 26278 | |
| 26279 | /* dSPACE RTICAN TX Message Block: "Std_COGSOGRapidUpdate_01" Id:7 */ |
| 26280 | { |
| 26281 | static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 26282 | 0x00 }; |
| 26283 | |
| 26284 | Float32 delayTime = 0.0; |
| 26285 | |
| 26286 | /* link this pointer to CAN_Msg for use in initialize_io_units() */ |
| 26287 | CANTP1_PTR_M3_C2_STD_0x7 = &(CAN_Msg[0]); |
| 26288 | |
| 26289 | /* ... perform loop-back if required */ |
| 26290 | if (L4_MABX_P.Constant1_Value_k > 0.5) { |
| 26291 | /* ... updating the used tx-clientbuffer */ |
| 26292 | can_tp1_msg_update_all( CANTP1_TX_M3_C2_MCRCLT_STD_0X7->module, |
| 26293 | CANTP1_TX_M3_C2_MCRCLT_STD_0X7->queue ); |
| 26294 | |
| 26295 | /* ... Read status and timestamp info perform loop-back (previous message) */ |
| 26296 | can_tp1_tx_msg_read_loopback(CANTP1_TX_M3_C2_MCRCLT_STD_0X7, |
| 26297 | 8, // datalen |
| 26298 | &(CAN_Msg[0]), |
| 26299 | CANTP1_RX_SPMSG_M3_C2_STD); |
| 26300 | |
| 26301 | /* Convert timestamp */ |
| 26302 | if (CANTP1_TX_M3_C2_MCRCLT_STD_0X7->processed) { |
| 26303 | CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp = |
| 26304 | rtk_dsts_time_to_simtime_convert |
| 26305 | (CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp); |
| 26306 | } |
| 26307 | } else { |
| 26308 | /* ... Read status and timestamp info (previous message) */ |
| 26309 | can_tp1_msg_read_from_dsmcr(CANTP1_TX_M3_C2_MCRCLT_STD_0X7); |
| 26310 | |
| 26311 | /* Convert timestamp */ |
| 26312 | if (CANTP1_TX_M3_C2_MCRCLT_STD_0X7->processed) { |
| 26313 | CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp = |
| 26314 | rtk_dsts_time_to_simtime_convert |
| 26315 | (CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp); |
| 26316 | } |
| 26317 | } |
| 26318 | |
| 26319 | /* Messages with timestamp zero have been received in pause/stop state |
| 26320 | and must not be handled. |
| 26321 | */ |
| 26322 | if (CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp > 0.0) { |
| 26323 | L4_MABX_B.SFunction1_o1_k = (real_T) |
| 26324 | CANTP1_TX_M3_C2_MCRCLT_STD_0X7->processed; |
| 26325 | L4_MABX_B.SFunction1_o2_pc = (real_T) |
| 26326 | CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp; |
| 26327 | L4_MABX_B.SFunction1_o3_iv = (real_T) |
| 26328 | CANTP1_TX_M3_C2_MCRCLT_STD_0X7->deltatime; |
| 26329 | L4_MABX_B.SFunction1_o4_i5 = (real_T) |
| 26330 | CANTP1_TX_M3_C2_MCRCLT_STD_0X7->delaytime; |
| 26331 | } |
| 26332 | |
| 26333 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 26334 | { |
| 26335 | rtican_Signal_t CAN_Sgn; |
| 26336 | UInt32 i; |
| 26337 | |
| 26338 | /* Initialize the static message data to zero */ |
| 26339 | for (i=0; i<8; i++ ) |
| 26340 | CAN_Msg[i] = 0; |
| 26341 | |
| 26342 | /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */ |
| 26343 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26344 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_bu ) + |
| 26345 | 0.5); |
| 26346 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26347 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26348 | |
| 26349 | /* ...... "COGReference" (8|2, standard signal, unsigned int, little endian) */ |
| 26350 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26351 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m ) + |
| 26352 | 0.5); |
| 26353 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26354 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 26355 | |
| 26356 | /* ...... "CourseOverGround" (16|16, standard signal, unsigned int, little endian) */ |
| 26357 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26358 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion2_ji - ( 0 |
| 26359 | ) ) / 0.0001 + 0.5); |
| 26360 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 26361 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 26362 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte1; |
| 26363 | |
| 26364 | /* ...... "SpeedOverGround" (32|16, standard signal, unsigned int, little endian) */ |
| 26365 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26366 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion3_p - ( 0 ) |
| 26367 | ) / 0.01 + 0.5); |
| 26368 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 26369 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 26370 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte1; |
| 26371 | } |
| 26372 | |
| 26373 | /* mask unused bits with '1' */ |
| 26374 | CAN_Msg[1] |= 0xFC; |
| 26375 | CAN_Msg[6] |= 0xFF; |
| 26376 | CAN_Msg[7] |= 0xFF; |
| 26377 | delayTime = (Float32) L4_MABX_P.Constant_Value_a3 / (2000); |
| 26378 | |
| 26379 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 26380 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X7], 8, &(CAN_Msg[0]), |
| 26381 | delayTime); |
| 26382 | } |
| 26383 | } |
| 26384 | |
| 26385 | /* End of Outputs for SubSystem: '<S912>/Std_COGSOGRapidUpdate_01' */ |
| 26386 | |
| 26387 | /* DataTypeConversion: '<S883>/Data Type Conversion2' incorporates: |
| 26388 | * Constant: '<S853>/enableEBC1_8B_TX' |
| 26389 | */ |
| 26390 | L4_MABX_B.DataTypeConversion2_pa = L4_MABX_P.enableEBC1_8B_TX_Value; |
| 26391 | |
| 26392 | /* Outputs for Enabled SubSystem: '<S914>/EBC1_TX' incorporates: |
| 26393 | * EnablePort: '<S915>/Enable' |
| 26394 | */ |
| 26395 | if (L4_MABX_B.DataTypeConversion2_pa) { |
| 26396 | /* S-Function (rti_commonblock): '<S915>/S-Function1' */ |
| 26397 | /* This comment workarounds a code generation problem */ |
| 26398 | |
| 26399 | /* dSPACE RTICAN TX Message Block: "EBC1_TX" Id:418382219 */ |
| 26400 | { |
| 26401 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 26402 | |
| 26403 | Float32 delayTime = 0.0; |
| 26404 | |
| 26405 | /* ... Read status and timestamp info (previous message) */ |
| 26406 | can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]); |
| 26407 | |
| 26408 | /* Convert timestamp */ |
| 26409 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->processed) { |
| 26410 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->timestamp = |
| 26411 | rtk_dsts_time_to_simtime_convert |
| 26412 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->timestamp); |
| 26413 | } |
| 26414 | |
| 26415 | /* Messages with timestamp zero have been received in pause/stop state |
| 26416 | and must not be handled. |
| 26417 | */ |
| 26418 | if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->timestamp > 0.0) { |
| 26419 | L4_MABX_B.SFunction1_o1_l = (real_T) |
| 26420 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->processed; |
| 26421 | L4_MABX_B.SFunction1_o2_p = (real_T) |
| 26422 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->timestamp; |
| 26423 | L4_MABX_B.SFunction1_o3_fs = (real_T) |
| 26424 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->deltatime; |
| 26425 | L4_MABX_B.SFunction1_o4_jc = (real_T) |
| 26426 | can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->delaytime; |
| 26427 | } |
| 26428 | |
| 26429 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 26430 | { |
| 26431 | rtican_Signal_t CAN_Sgn; |
| 26432 | |
| 26433 | /* ...... "ASREngCtrlActive" (0|2, standard signal, unsigned int, little endian) */ |
| 26434 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26435 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ASREngCtrlActive ) + 0.5); |
| 26436 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26437 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26438 | |
| 26439 | /* ...... "ASRBrakeCtrlActive" (2|2, standard signal, unsigned int, little endian) */ |
| 26440 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26441 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ASRBrakeCtrlActive ) + 0.5); |
| 26442 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26443 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 26444 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26445 | |
| 26446 | /* ...... "AntiLockBrakingActive" (4|2, standard signal, unsigned int, little endian) */ |
| 26447 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26448 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AntiLockBrakingActive ) + |
| 26449 | 0.5); |
| 26450 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26451 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 26452 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26453 | |
| 26454 | /* ...... "EBSBrakeSwitch" (6|2, standard signal, unsigned int, little endian) */ |
| 26455 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26456 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EBSBrakeSwitch_b ) + 0.5); |
| 26457 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26458 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 26459 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 26460 | |
| 26461 | /* ...... "BrakePedalPos" (8|8, standard signal, unsigned int, little endian) */ |
| 26462 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26463 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.BrakePedalPos - ( 0 ) ) / |
| 26464 | 0.4 + 0.5); |
| 26465 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26466 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 26467 | |
| 26468 | /* ...... "ABSOffroadSwitch" (16|2, standard signal, unsigned int, little endian) */ |
| 26469 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26470 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ABSOffroadSwitch ) + 0.5); |
| 26471 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26472 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 26473 | |
| 26474 | /* ...... "ASROffroadSwitch" (18|2, standard signal, unsigned int, little endian) */ |
| 26475 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26476 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ASROffroadSwitch ) + 0.5); |
| 26477 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26478 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 26479 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 26480 | |
| 26481 | /* ...... "ASRHillHolderSwitch" (20|2, standard signal, unsigned int, little endian) */ |
| 26482 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26483 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ASRHillHolderSwitch ) + 0.5); |
| 26484 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26485 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 26486 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 26487 | |
| 26488 | /* ...... "TractionCtrlOverrideSwitch" (22|2, standard signal, unsigned int, little endian) */ |
| 26489 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26490 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.TractionCtrlOverrideSwitch ) |
| 26491 | + 0.5); |
| 26492 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26493 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 26494 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 26495 | |
| 26496 | /* ...... "AccelInterlockSwitch" (24|2, standard signal, unsigned int, little endian) */ |
| 26497 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26498 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AccelInterlockSwitch ) + 0.5); |
| 26499 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26500 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 26501 | |
| 26502 | /* ...... "EngDerateSwitch" (26|2, standard signal, unsigned int, little endian) */ |
| 26503 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26504 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngDerateSwitch ) + 0.5); |
| 26505 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26506 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 26507 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 26508 | |
| 26509 | /* ...... "EngAuxShutdownSwitch" (28|2, standard signal, unsigned int, little endian) */ |
| 26510 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26511 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngAuxShutdownSwitch ) + 0.5); |
| 26512 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26513 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 26514 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 26515 | |
| 26516 | /* ...... "RemoteAccelEnableSwitch" (30|2, standard signal, unsigned int, little endian) */ |
| 26517 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26518 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.RemoteAccelEnableSwitch ) + |
| 26519 | 0.5); |
| 26520 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26521 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 26522 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 26523 | |
| 26524 | /* ...... "EngRetarderSelection" (32|8, standard signal, unsigned int, little endian) */ |
| 26525 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26526 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngRetarderSelection - ( 0 ) |
| 26527 | ) / 0.4 + 0.5); |
| 26528 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26529 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 26530 | |
| 26531 | /* ...... "ABSFullyOperational" (40|2, standard signal, unsigned int, little endian) */ |
| 26532 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26533 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ABSFullyOperational ) + 0.5); |
| 26534 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26535 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 26536 | |
| 26537 | /* ...... "EBSRedWarningSignal" (42|2, standard signal, unsigned int, little endian) */ |
| 26538 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26539 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EBSRedWarningSignal ) + 0.5); |
| 26540 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26541 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 26542 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 26543 | |
| 26544 | /* ...... "ABS_EBSAmberWarningSignal" (44|2, standard signal, unsigned int, little endian) */ |
| 26545 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26546 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ABS_EBSAmberWarningSignal ) |
| 26547 | + 0.5); |
| 26548 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26549 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 26550 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 26551 | |
| 26552 | /* ...... "ATC_ASRInformationSignal" (46|2, standard signal, unsigned int, little endian) */ |
| 26553 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26554 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ATC_ASRInformationSignal ) + |
| 26555 | 0.5); |
| 26556 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26557 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 26558 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 26559 | |
| 26560 | /* ...... "SrcAddrssOfCtrllngDvcFrBrkCntrl" (48|8, standard signal, unsigned int, little endian) */ |
| 26561 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26562 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 26563 | (( L4_MABX_B.SrcAddrssOfCtrllngDvcFrBrkCntrl ) + 0.5); |
| 26564 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 26565 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 26566 | |
| 26567 | /* ...... "HaltBrakeSwitch" (58|2, standard signal, unsigned int, little endian) */ |
| 26568 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26569 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.HaltBrakeSwitch ) + 0.5); |
| 26570 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26571 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2; |
| 26572 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26573 | |
| 26574 | /* ...... "TrailerABSStatus" (60|2, standard signal, unsigned int, little endian) */ |
| 26575 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26576 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.TrailerABSStatus ) + 0.5); |
| 26577 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26578 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4; |
| 26579 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26580 | |
| 26581 | /* ...... "TrctrMntdTrilerABSWarningSignal" (62|2, standard signal, unsigned int, little endian) */ |
| 26582 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 26583 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 26584 | (( L4_MABX_B.TrctrMntdTrilerABSWarningSignal ) + 0.5); |
| 26585 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 26586 | CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6; |
| 26587 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 26588 | } |
| 26589 | |
| 26590 | /* mask unused bits with '1' */ |
| 26591 | CAN_Msg[7] |= 0x03; |
| 26592 | |
| 26593 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 26594 | can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B], 8, |
| 26595 | &(CAN_Msg[0]), delayTime); |
| 26596 | } |
| 26597 | } |
| 26598 | |
| 26599 | /* End of Outputs for SubSystem: '<S914>/EBC1_TX' */ |
| 26600 | |
| 26601 | /* End of Outputs for SubSystem: '<S849>/CAN_TX_100ms' */ |
| 26602 | |
| 26603 | /* DiscretePulseGenerator: '<S1078>/Flash' */ |
| 26604 | L4_MABX_B.Flash = (L4_MABX_DW.clockTickCounter_d < L4_MABX_P.Flash_Duty) && |
| 26605 | (L4_MABX_DW.clockTickCounter_d >= 0) ? L4_MABX_P.Flash_Amp : 0.0; |
| 26606 | if (L4_MABX_DW.clockTickCounter_d >= L4_MABX_P.Flash_Period - 1.0) { |
| 26607 | L4_MABX_DW.clockTickCounter_d = 0; |
| 26608 | } else { |
| 26609 | L4_MABX_DW.clockTickCounter_d++; |
| 26610 | } |
| 26611 | |
| 26612 | /* End of DiscretePulseGenerator: '<S1078>/Flash' */ |
| 26613 | /* user code (Output function Trailer for TID3) */ |
| 26614 | |
| 26615 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 26616 | /* EventChannel: 0 */ |
| 26617 | if (tid == 0) { |
| 26618 | DSXCP_service(0); |
| 26619 | } |
| 26620 | |
| 26621 | /* If subsystem generates rate grouping Output functions, |
| 26622 | * when tid is used in Output function for one rate, |
| 26623 | * all Output functions include tid as a local variable. |
| 26624 | * As result, some Output functions may have unused tid. |
| 26625 | */ |
| 26626 | UNUSED_PARAMETER(tid); |
| 26627 | } |
| 26628 | |
| 26629 | /* Model update function for TID3 */ |
| 26630 | void L4_MABX_update3(void) /* Sample time: [0.1s, 0.0s] */ |
| 26631 | { |
| 26632 | /* Update for Atomic SubSystem: '<S849>/CAN_TX_100ms' */ |
| 26633 | |
| 26634 | /* Update for Enabled SubSystem: '<S886>/Rolling_15_counter' incorporates: |
| 26635 | * EnablePort: '<S928>/Enable' |
| 26636 | */ |
| 26637 | if (L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_R) { |
| 26638 | /* Update for UnitDelay: '<S928>/Unit_Delay' */ |
| 26639 | L4_MABX_DW.Unit_Delay_DSTATE = L4_MABX_B.FixPtSwitch; |
| 26640 | } |
| 26641 | |
| 26642 | /* End of Update for SubSystem: '<S886>/Rolling_15_counter' */ |
| 26643 | |
| 26644 | /* End of Update for SubSystem: '<S849>/CAN_TX_100ms' */ |
| 26645 | |
| 26646 | /* Update for RateTransition: '<S1078>/TmpRTBAtANDInport1' */ |
| 26647 | L4_MABX_DW.TmpRTBAtANDInport1_Buffer0 = L4_MABX_B.Flash; |
| 26648 | } |
| 26649 | |
| 26650 | /* Model output function for TID4 */ |
| 26651 | void L4_MABX_output4(void) /* Sample time: [0.25s, 0.0s] */ |
| 26652 | { |
| 26653 | int_T tid = 4; |
| 26654 | |
| 26655 | /* user code (Output function Trailer for TID4) */ |
| 26656 | |
| 26657 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 26658 | /* EventChannel: 0 */ |
| 26659 | if (tid == 0) { |
| 26660 | DSXCP_service(0); |
| 26661 | } |
| 26662 | |
| 26663 | /* If subsystem generates rate grouping Output functions, |
| 26664 | * when tid is used in Output function for one rate, |
| 26665 | * all Output functions include tid as a local variable. |
| 26666 | * As result, some Output functions may have unused tid. |
| 26667 | */ |
| 26668 | UNUSED_PARAMETER(tid); |
| 26669 | } |
| 26670 | |
| 26671 | /* Model update function for TID4 */ |
| 26672 | void L4_MABX_update4(void) /* Sample time: [0.25s, 0.0s] */ |
| 26673 | { |
| 26674 | /* (no update code required) */ |
| 26675 | } |
| 26676 | |
| 26677 | /* Model output function for TID5 */ |
| 26678 | void L4_MABX_output5(void) /* Sample time: [0.5s, 0.0s] */ |
| 26679 | { |
| 26680 | int_T tid = 5; |
| 26681 | boolean_T zcEvent; |
| 26682 | uint32_T q0; |
| 26683 | uint32_T qY; |
| 26684 | |
| 26685 | /* S-Function (rti_commonblock): '<S28>/S-Function1' */ |
| 26686 | /* This comment workarounds a code generation problem */ |
| 26687 | |
| 26688 | /* dSPACE RTICAN Status block */ |
| 26689 | /* ... read status variables of the CAN microcontroller */ |
| 26690 | { |
| 26691 | UInt32 loop_counter, memory, j; |
| 26692 | for (j=0;j<=9;j++) { |
| 26693 | rtican_type1_tq_error[0][6] = can_tp1_service_read |
| 26694 | (can_type1_service_M1_C1[j]); |
| 26695 | loop_counter = 0; |
| 26696 | while ((rtican_type1_tq_error[0][6] = can_tp1_service_request |
| 26697 | (can_type1_service_M1_C1[j]))== DSMCOM_BUFFER_OVERFLOW) { |
| 26698 | loop_counter++; |
| 26699 | if (loop_counter > MAX_LOOP) { |
| 26700 | memory = rtican_type1_error_level; |
| 26701 | rtican_type1_error_level = 1; |
| 26702 | rtican_type1_tq_err_sig(0, 6); |
| 26703 | rtican_type1_error_level = memory; |
| 26704 | break; |
| 26705 | } |
| 26706 | } |
| 26707 | |
| 26708 | if (j==CANTP1_M1_C1_RXLost) { |
| 26709 | rtican_type1_tq_error[0][6] = can_tp1_service_read |
| 26710 | (can_type1_service_M1_C1[CANTP1_M1_C1_DataLost]); |
| 26711 | loop_counter = 0; |
| 26712 | while ((rtican_type1_tq_error[0][6] = can_tp1_service_request |
| 26713 | (can_type1_service_M1_C1[CANTP1_M1_C1_DataLost]))== |
| 26714 | DSMCOM_BUFFER_OVERFLOW) { |
| 26715 | loop_counter++; |
| 26716 | if (loop_counter > MAX_LOOP) { |
| 26717 | memory = rtican_type1_error_level; |
| 26718 | rtican_type1_error_level = 1; |
| 26719 | rtican_type1_tq_err_sig(0, 6); |
| 26720 | rtican_type1_error_level = memory; |
| 26721 | break; |
| 26722 | } |
| 26723 | } |
| 26724 | } |
| 26725 | } |
| 26726 | |
| 26727 | L4_MABX_B.SFunction1_o1_kx = (UInt32) |
| 26728 | can_type1_service_M1_C1[CANTP1_M1_C1_Status]->data0; |
| 26729 | DIAG_CAN1_Count_Stuff_Errors = (UInt32) |
| 26730 | can_type1_service_M1_C1[CANTP1_M1_C1_StuffErrors]->data0; |
| 26731 | DIAG_CAN1_Count_Format_Errors = (UInt32) |
| 26732 | can_type1_service_M1_C1[CANTP1_M1_C1_FormatErrors]->data0; |
| 26733 | DIAG_CAN1_Count_Ack_Errors = (UInt32) |
| 26734 | can_type1_service_M1_C1[CANTP1_M1_C1_AckErrors]->data0; |
| 26735 | DIAG_CAN1_Count_Bit0_Errors = (UInt32) |
| 26736 | can_type1_service_M1_C1[CANTP1_M1_C1_Bit0Errors]->data0; |
| 26737 | DIAG_CAN1_Count_Bit1_Errors = (UInt32) |
| 26738 | can_type1_service_M1_C1[CANTP1_M1_C1_Bit1Errors]->data0; |
| 26739 | DIAG_CAN1_Count_CRC_Errors = (UInt32) |
| 26740 | can_type1_service_M1_C1[CANTP1_M1_C1_CRCErrors]->data0; |
| 26741 | DIAG_CAN1_Count_RX_Lost = (UInt32) |
| 26742 | (can_type1_service_M1_C1[CANTP1_M1_C1_RXLost]->data0 + |
| 26743 | can_type1_service_M1_C1[CANTP1_M1_C1_DataLost]->data0); |
| 26744 | DIAG_CAN1_Count_RX_OK = (UInt32) can_type1_service_M1_C1[CANTP1_M1_C1_RXOK |
| 26745 | ]->data0; |
| 26746 | DIAG_CAN1_Count_TX_OK = (UInt32) can_type1_service_M1_C1[CANTP1_M1_C1_TXOK |
| 26747 | ]->data0; |
| 26748 | } |
| 26749 | |
| 26750 | /* DataTypeConversion: '<S1>/Data Type Conversion' */ |
| 26751 | DIAG_CAN1_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI |
| 26752 | ((int32_T)L4_MABX_B.SFunction1_o1_kx); |
| 26753 | |
| 26754 | /* RelationalOperator: '<S22>/Operator' incorporates: |
| 26755 | * Constant: '<S1>/Constant' |
| 26756 | */ |
| 26757 | L4_MABX_B.Operator_eu = (L4_MABX_P.Constant_Value_cq == DIAG_CAN1_Status); |
| 26758 | |
| 26759 | /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_1' incorporates: |
| 26760 | * EnablePort: '<S11>/Enable' |
| 26761 | */ |
| 26762 | if (L4_MABX_B.Operator_eu) { |
| 26763 | /* Reshape: '<S30>/Reshape' incorporates: |
| 26764 | * Constant: '<S30>/Constant' |
| 26765 | */ |
| 26766 | L4_MABX_B.Reshape_g[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_l[0]; |
| 26767 | L4_MABX_B.Reshape_g[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_l[1]; |
| 26768 | |
| 26769 | /* UnitDelay: '<S30>/Unit_Delay' */ |
| 26770 | L4_MABX_B.Unit_Delay_h4 = L4_MABX_DW.Unit_Delay_DSTATE_f1; |
| 26771 | |
| 26772 | /* UnitDelay: '<S31>/Unit Delay' */ |
| 26773 | L4_MABX_B.UnitDelay_f4 = L4_MABX_DW.UnitDelay_DSTATE_j; |
| 26774 | |
| 26775 | /* Switch: '<S34>/Switch1' incorporates: |
| 26776 | * Constant: '<S31>/E' |
| 26777 | * Constant: '<S31>/IV' |
| 26778 | * Switch: '<S33>/Switch1' |
| 26779 | */ |
| 26780 | if (L4_MABX_B.Unit_Delay_h4) { |
| 26781 | L4_MABX_B.Switch1_o0 = L4_MABX_P.IV_Value_m; |
| 26782 | } else { |
| 26783 | if (L4_MABX_P.E_Value) { |
| 26784 | /* Sum: '<S31>/Subtract' incorporates: |
| 26785 | * Constant: '<S31>/Constant' |
| 26786 | * Switch: '<S33>/Switch1' |
| 26787 | */ |
| 26788 | q0 = L4_MABX_P.Constant_Value_jc3; |
| 26789 | qY = q0 + L4_MABX_B.UnitDelay_f4; |
| 26790 | if (qY < q0) { |
| 26791 | qY = MAX_uint32_T; |
| 26792 | } |
| 26793 | |
| 26794 | L4_MABX_B.Subtract_ot = qY; |
| 26795 | |
| 26796 | /* End of Sum: '<S31>/Subtract' */ |
| 26797 | |
| 26798 | /* Switch: '<S33>/Switch1' */ |
| 26799 | L4_MABX_B.Switch1_a = L4_MABX_B.Subtract_ot; |
| 26800 | } else { |
| 26801 | /* Switch: '<S33>/Switch1' */ |
| 26802 | L4_MABX_B.Switch1_a = L4_MABX_B.UnitDelay_f4; |
| 26803 | } |
| 26804 | |
| 26805 | L4_MABX_B.Switch1_o0 = L4_MABX_B.Switch1_a; |
| 26806 | } |
| 26807 | |
| 26808 | /* End of Switch: '<S34>/Switch1' */ |
| 26809 | |
| 26810 | /* Selector: '<S30>/Selector' */ |
| 26811 | L4_MABX_B.Selector_da = L4_MABX_B.Reshape_g[(int32_T)L4_MABX_B.Switch1_o0 - |
| 26812 | 1]; |
| 26813 | |
| 26814 | /* Outputs for Triggered SubSystem: '<S11>/CAN_TYPE1_BOR_M1_C1' incorporates: |
| 26815 | * TriggerPort: '<S29>/Trigger' |
| 26816 | */ |
| 26817 | zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C1_Trig_ZCE == POS_ZCSIG) != |
| 26818 | (int32_T)L4_MABX_B.Selector_da) && |
| 26819 | (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C1_Trig_ZCE != |
| 26820 | UNINITIALIZED_ZCSIG)); |
| 26821 | if (zcEvent) { |
| 26822 | /* S-Function (rti_commonblock): '<S29>/S-Function1' */ |
| 26823 | /* This comment workarounds a code generation problem */ |
| 26824 | |
| 26825 | /* dSPACE RTICAN Bus Off Recovery block */ |
| 26826 | /* ... Perform software-reset of the CAN microcontroller */ |
| 26827 | { |
| 26828 | UInt32 loop_counter, memory; |
| 26829 | loop_counter = 0; |
| 26830 | while ((rtican_type1_tq_error[0][0] = can_tp1_channel_BOff_return |
| 26831 | (can_type1_channel_M1_C1)) == DSMCOM_BUFFER_OVERFLOW) { |
| 26832 | loop_counter++; |
| 26833 | if (loop_counter > MAX_LOOP) { |
| 26834 | memory = rtican_type1_error_level; |
| 26835 | rtican_type1_error_level = 1; |
| 26836 | rtican_type1_tq_err_sig(0, 0); |
| 26837 | rtican_type1_error_level = memory; |
| 26838 | break; |
| 26839 | } |
| 26840 | } |
| 26841 | |
| 26842 | while ((rtican_type1_tq_error[0][0] = can_tp1_channel_all_wakeup |
| 26843 | (can_type1_channel_M1_C1)) == DSMCOM_BUFFER_OVERFLOW) { |
| 26844 | loop_counter++; |
| 26845 | if (loop_counter > MAX_LOOP) { |
| 26846 | memory = rtican_type1_error_level; |
| 26847 | rtican_type1_error_level = 1; |
| 26848 | rtican_type1_tq_err_sig(0, 0); |
| 26849 | rtican_type1_error_level = memory; |
| 26850 | break; |
| 26851 | } |
| 26852 | } |
| 26853 | } |
| 26854 | } |
| 26855 | |
| 26856 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C1_Trig_ZCE = L4_MABX_B.Selector_da; |
| 26857 | |
| 26858 | /* End of Outputs for SubSystem: '<S11>/CAN_TYPE1_BOR_M1_C1' */ |
| 26859 | |
| 26860 | /* RelationalOperator: '<S32>/Operator' */ |
| 26861 | L4_MABX_B.Operator_f5 = (L4_MABX_B.Switch1_o0 == L4_MABX_ConstB.Width_p); |
| 26862 | } |
| 26863 | |
| 26864 | /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_1' */ |
| 26865 | |
| 26866 | /* S-Function (rti_commonblock): '<S20>/S-Function1' */ |
| 26867 | /* This comment workarounds a code generation problem */ |
| 26868 | |
| 26869 | /* dSPACE RTICAN Status block */ |
| 26870 | /* ... read status variables of the CAN microcontroller */ |
| 26871 | { |
| 26872 | UInt32 loop_counter, memory, j; |
| 26873 | for (j=0;j<=9;j++) { |
| 26874 | rtican_type1_tq_error[2][6] = can_tp1_service_read |
| 26875 | (can_type1_service_M3_C1[j]); |
| 26876 | loop_counter = 0; |
| 26877 | while ((rtican_type1_tq_error[2][6] = can_tp1_service_request |
| 26878 | (can_type1_service_M3_C1[j]))== DSMCOM_BUFFER_OVERFLOW) { |
| 26879 | loop_counter++; |
| 26880 | if (loop_counter > MAX_LOOP) { |
| 26881 | memory = rtican_type1_error_level; |
| 26882 | rtican_type1_error_level = 1; |
| 26883 | rtican_type1_tq_err_sig(2, 6); |
| 26884 | rtican_type1_error_level = memory; |
| 26885 | break; |
| 26886 | } |
| 26887 | } |
| 26888 | |
| 26889 | if (j==CANTP1_M3_C1_RXLost) { |
| 26890 | rtican_type1_tq_error[2][6] = can_tp1_service_read |
| 26891 | (can_type1_service_M3_C1[CANTP1_M3_C1_DataLost]); |
| 26892 | loop_counter = 0; |
| 26893 | while ((rtican_type1_tq_error[2][6] = can_tp1_service_request |
| 26894 | (can_type1_service_M3_C1[CANTP1_M3_C1_DataLost]))== |
| 26895 | DSMCOM_BUFFER_OVERFLOW) { |
| 26896 | loop_counter++; |
| 26897 | if (loop_counter > MAX_LOOP) { |
| 26898 | memory = rtican_type1_error_level; |
| 26899 | rtican_type1_error_level = 1; |
| 26900 | rtican_type1_tq_err_sig(2, 6); |
| 26901 | rtican_type1_error_level = memory; |
| 26902 | break; |
| 26903 | } |
| 26904 | } |
| 26905 | } |
| 26906 | } |
| 26907 | |
| 26908 | L4_MABX_B.SFunction1_o1_g3 = (UInt32) |
| 26909 | can_type1_service_M3_C1[CANTP1_M3_C1_Status]->data0; |
| 26910 | DIAG_CAN5_Count_Stuff_Errors = (UInt32) |
| 26911 | can_type1_service_M3_C1[CANTP1_M3_C1_StuffErrors]->data0; |
| 26912 | DIAG_CAN5_Count_Format_Errors = (UInt32) |
| 26913 | can_type1_service_M3_C1[CANTP1_M3_C1_FormatErrors]->data0; |
| 26914 | DIAG_CAN5_Count_Ack_Errors = (UInt32) |
| 26915 | can_type1_service_M3_C1[CANTP1_M3_C1_AckErrors]->data0; |
| 26916 | DIAG_CAN5_Count_Bit0_Errors = (UInt32) |
| 26917 | can_type1_service_M3_C1[CANTP1_M3_C1_Bit0Errors]->data0; |
| 26918 | DIAG_CAN5_Count_Bit1_Errors = (UInt32) |
| 26919 | can_type1_service_M3_C1[CANTP1_M3_C1_Bit1Errors]->data0; |
| 26920 | DIAG_CAN5_Count_CRC_Errors = (UInt32) |
| 26921 | can_type1_service_M3_C1[CANTP1_M3_C1_CRCErrors]->data0; |
| 26922 | DIAG_CAN5_Count_RX_Lost = (UInt32) |
| 26923 | (can_type1_service_M3_C1[CANTP1_M3_C1_RXLost]->data0 + |
| 26924 | can_type1_service_M3_C1[CANTP1_M3_C1_DataLost]->data0); |
| 26925 | DIAG_CAN5_Count_RX_OK = (UInt32) can_type1_service_M3_C1[CANTP1_M3_C1_RXOK |
| 26926 | ]->data0; |
| 26927 | DIAG_CAN5_Count_TX_OK = (UInt32) can_type1_service_M3_C1[CANTP1_M3_C1_TXOK |
| 26928 | ]->data0; |
| 26929 | } |
| 26930 | |
| 26931 | /* DataTypeConversion: '<S1>/Data Type Conversion5' */ |
| 26932 | DIAG_CAN5_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI |
| 26933 | ((int32_T)L4_MABX_B.SFunction1_o1_g3); |
| 26934 | |
| 26935 | /* RelationalOperator: '<S26>/Operator' incorporates: |
| 26936 | * Constant: '<S1>/Constant4' |
| 26937 | */ |
| 26938 | L4_MABX_B.Operator_ms = (L4_MABX_P.Constant4_Value_np == DIAG_CAN5_Status); |
| 26939 | |
| 26940 | /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_5' incorporates: |
| 26941 | * EnablePort: '<S15>/Enable' |
| 26942 | */ |
| 26943 | if (L4_MABX_B.Operator_ms) { |
| 26944 | /* Reshape: '<S54>/Reshape' incorporates: |
| 26945 | * Constant: '<S54>/Constant' |
| 26946 | */ |
| 26947 | L4_MABX_B.Reshape_a[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_j[0]; |
| 26948 | L4_MABX_B.Reshape_a[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_j[1]; |
| 26949 | |
| 26950 | /* UnitDelay: '<S54>/Unit_Delay' */ |
| 26951 | L4_MABX_B.Unit_Delay_p1 = L4_MABX_DW.Unit_Delay_DSTATE_i5y; |
| 26952 | |
| 26953 | /* UnitDelay: '<S55>/Unit Delay' */ |
| 26954 | L4_MABX_B.UnitDelay_j = L4_MABX_DW.UnitDelay_DSTATE_p; |
| 26955 | |
| 26956 | /* Switch: '<S58>/Switch1' incorporates: |
| 26957 | * Constant: '<S55>/E' |
| 26958 | * Constant: '<S55>/IV' |
| 26959 | * Switch: '<S57>/Switch1' |
| 26960 | */ |
| 26961 | if (L4_MABX_B.Unit_Delay_p1) { |
| 26962 | L4_MABX_B.Switch1_k = L4_MABX_P.IV_Value_h; |
| 26963 | } else { |
| 26964 | if (L4_MABX_P.E_Value_db) { |
| 26965 | /* Sum: '<S55>/Subtract' incorporates: |
| 26966 | * Constant: '<S55>/Constant' |
| 26967 | * Switch: '<S57>/Switch1' |
| 26968 | */ |
| 26969 | q0 = L4_MABX_P.Constant_Value_jg; |
| 26970 | qY = q0 + L4_MABX_B.UnitDelay_j; |
| 26971 | if (qY < q0) { |
| 26972 | qY = MAX_uint32_T; |
| 26973 | } |
| 26974 | |
| 26975 | L4_MABX_B.Subtract_m = qY; |
| 26976 | |
| 26977 | /* End of Sum: '<S55>/Subtract' */ |
| 26978 | |
| 26979 | /* Switch: '<S57>/Switch1' */ |
| 26980 | L4_MABX_B.Switch1_lh = L4_MABX_B.Subtract_m; |
| 26981 | } else { |
| 26982 | /* Switch: '<S57>/Switch1' */ |
| 26983 | L4_MABX_B.Switch1_lh = L4_MABX_B.UnitDelay_j; |
| 26984 | } |
| 26985 | |
| 26986 | L4_MABX_B.Switch1_k = L4_MABX_B.Switch1_lh; |
| 26987 | } |
| 26988 | |
| 26989 | /* End of Switch: '<S58>/Switch1' */ |
| 26990 | |
| 26991 | /* Selector: '<S54>/Selector' */ |
| 26992 | L4_MABX_B.Selector_p = L4_MABX_B.Reshape_a[(int32_T)L4_MABX_B.Switch1_k - 1]; |
| 26993 | |
| 26994 | /* Outputs for Triggered SubSystem: '<S15>/CAN_TYPE1_BOR_M3_C1' incorporates: |
| 26995 | * TriggerPort: '<S53>/Trigger' |
| 26996 | */ |
| 26997 | zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C1_Trig_ZCE == POS_ZCSIG) != |
| 26998 | (int32_T)L4_MABX_B.Selector_p) && |
| 26999 | (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C1_Trig_ZCE != |
| 27000 | UNINITIALIZED_ZCSIG)); |
| 27001 | if (zcEvent) { |
| 27002 | /* S-Function (rti_commonblock): '<S53>/S-Function1' */ |
| 27003 | /* This comment workarounds a code generation problem */ |
| 27004 | |
| 27005 | /* dSPACE RTICAN Bus Off Recovery block */ |
| 27006 | /* ... Perform software-reset of the CAN microcontroller */ |
| 27007 | { |
| 27008 | UInt32 loop_counter, memory; |
| 27009 | loop_counter = 0; |
| 27010 | while ((rtican_type1_tq_error[2][0] = can_tp1_channel_BOff_return |
| 27011 | (can_type1_channel_M3_C1)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27012 | loop_counter++; |
| 27013 | if (loop_counter > MAX_LOOP) { |
| 27014 | memory = rtican_type1_error_level; |
| 27015 | rtican_type1_error_level = 1; |
| 27016 | rtican_type1_tq_err_sig(2, 0); |
| 27017 | rtican_type1_error_level = memory; |
| 27018 | break; |
| 27019 | } |
| 27020 | } |
| 27021 | |
| 27022 | while ((rtican_type1_tq_error[2][0] = can_tp1_channel_all_wakeup |
| 27023 | (can_type1_channel_M3_C1)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27024 | loop_counter++; |
| 27025 | if (loop_counter > MAX_LOOP) { |
| 27026 | memory = rtican_type1_error_level; |
| 27027 | rtican_type1_error_level = 1; |
| 27028 | rtican_type1_tq_err_sig(2, 0); |
| 27029 | rtican_type1_error_level = memory; |
| 27030 | break; |
| 27031 | } |
| 27032 | } |
| 27033 | } |
| 27034 | } |
| 27035 | |
| 27036 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C1_Trig_ZCE = L4_MABX_B.Selector_p; |
| 27037 | |
| 27038 | /* End of Outputs for SubSystem: '<S15>/CAN_TYPE1_BOR_M3_C1' */ |
| 27039 | |
| 27040 | /* RelationalOperator: '<S56>/Operator' */ |
| 27041 | L4_MABX_B.Operator_ho0 = (L4_MABX_B.Switch1_k == L4_MABX_ConstB.Width_a); |
| 27042 | } |
| 27043 | |
| 27044 | /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_5' */ |
| 27045 | |
| 27046 | /* S-Function (rti_commonblock): '<S21>/S-Function1' */ |
| 27047 | /* This comment workarounds a code generation problem */ |
| 27048 | |
| 27049 | /* dSPACE RTICAN Status block */ |
| 27050 | /* ... read status variables of the CAN microcontroller */ |
| 27051 | { |
| 27052 | UInt32 loop_counter, memory, j; |
| 27053 | for (j=0;j<=9;j++) { |
| 27054 | rtican_type1_tq_error[2][6] = can_tp1_service_read |
| 27055 | (can_type1_service_M3_C2[j]); |
| 27056 | loop_counter = 0; |
| 27057 | while ((rtican_type1_tq_error[2][6] = can_tp1_service_request |
| 27058 | (can_type1_service_M3_C2[j]))== DSMCOM_BUFFER_OVERFLOW) { |
| 27059 | loop_counter++; |
| 27060 | if (loop_counter > MAX_LOOP) { |
| 27061 | memory = rtican_type1_error_level; |
| 27062 | rtican_type1_error_level = 1; |
| 27063 | rtican_type1_tq_err_sig(2, 6); |
| 27064 | rtican_type1_error_level = memory; |
| 27065 | break; |
| 27066 | } |
| 27067 | } |
| 27068 | |
| 27069 | if (j==CANTP1_M3_C2_RXLost) { |
| 27070 | rtican_type1_tq_error[2][6] = can_tp1_service_read |
| 27071 | (can_type1_service_M3_C2[CANTP1_M3_C2_DataLost]); |
| 27072 | loop_counter = 0; |
| 27073 | while ((rtican_type1_tq_error[2][6] = can_tp1_service_request |
| 27074 | (can_type1_service_M3_C2[CANTP1_M3_C2_DataLost]))== |
| 27075 | DSMCOM_BUFFER_OVERFLOW) { |
| 27076 | loop_counter++; |
| 27077 | if (loop_counter > MAX_LOOP) { |
| 27078 | memory = rtican_type1_error_level; |
| 27079 | rtican_type1_error_level = 1; |
| 27080 | rtican_type1_tq_err_sig(2, 6); |
| 27081 | rtican_type1_error_level = memory; |
| 27082 | break; |
| 27083 | } |
| 27084 | } |
| 27085 | } |
| 27086 | } |
| 27087 | |
| 27088 | L4_MABX_B.SFunction1_o1_ar = (UInt32) |
| 27089 | can_type1_service_M3_C2[CANTP1_M3_C2_Status]->data0; |
| 27090 | DIAG_CAN6_Count_Stuff_Errors = (UInt32) |
| 27091 | can_type1_service_M3_C2[CANTP1_M3_C2_StuffErrors]->data0; |
| 27092 | DIAG_CAN6_Count_Format_Errors = (UInt32) |
| 27093 | can_type1_service_M3_C2[CANTP1_M3_C2_FormatErrors]->data0; |
| 27094 | DIAG_CAN6_Count_Ack_Errors = (UInt32) |
| 27095 | can_type1_service_M3_C2[CANTP1_M3_C2_AckErrors]->data0; |
| 27096 | DIAG_CAN6_Count_Bit0_Errors = (UInt32) |
| 27097 | can_type1_service_M3_C2[CANTP1_M3_C2_Bit0Errors]->data0; |
| 27098 | DIAG_CAN6_Count_Bit1_Errors = (UInt32) |
| 27099 | can_type1_service_M3_C2[CANTP1_M3_C2_Bit1Errors]->data0; |
| 27100 | DIAG_CAN6_Count_CRC_Errors = (UInt32) |
| 27101 | can_type1_service_M3_C2[CANTP1_M3_C2_CRCErrors]->data0; |
| 27102 | DIAG_CAN6_Count_RX_Lost = (UInt32) |
| 27103 | (can_type1_service_M3_C2[CANTP1_M3_C2_RXLost]->data0 + |
| 27104 | can_type1_service_M3_C2[CANTP1_M3_C2_DataLost]->data0); |
| 27105 | DIAG_CAN6_Count_RX_OK = (UInt32) can_type1_service_M3_C2[CANTP1_M3_C2_RXOK |
| 27106 | ]->data0; |
| 27107 | DIAG_CAN6_Count_TX_OK = (UInt32) can_type1_service_M3_C2[CANTP1_M3_C2_TXOK |
| 27108 | ]->data0; |
| 27109 | } |
| 27110 | |
| 27111 | /* DataTypeConversion: '<S1>/Data Type Conversion4' */ |
| 27112 | DIAG_CAN6_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI |
| 27113 | ((int32_T)L4_MABX_B.SFunction1_o1_ar); |
| 27114 | |
| 27115 | /* RelationalOperator: '<S27>/Operator' incorporates: |
| 27116 | * Constant: '<S1>/Constant5' |
| 27117 | */ |
| 27118 | L4_MABX_B.Operator_fve = (L4_MABX_P.Constant5_Value_mf == DIAG_CAN6_Status); |
| 27119 | |
| 27120 | /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_6' incorporates: |
| 27121 | * EnablePort: '<S16>/Enable' |
| 27122 | */ |
| 27123 | if (L4_MABX_B.Operator_fve) { |
| 27124 | /* Reshape: '<S60>/Reshape' incorporates: |
| 27125 | * Constant: '<S60>/Constant' |
| 27126 | */ |
| 27127 | L4_MABX_B.Reshape_j[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_e[0]; |
| 27128 | L4_MABX_B.Reshape_j[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_e[1]; |
| 27129 | |
| 27130 | /* UnitDelay: '<S60>/Unit_Delay' */ |
| 27131 | L4_MABX_B.Unit_Delay_mw = L4_MABX_DW.Unit_Delay_DSTATE_l5; |
| 27132 | |
| 27133 | /* UnitDelay: '<S61>/Unit Delay' */ |
| 27134 | L4_MABX_B.UnitDelay_a = L4_MABX_DW.UnitDelay_DSTATE_dr; |
| 27135 | |
| 27136 | /* Switch: '<S64>/Switch1' incorporates: |
| 27137 | * Constant: '<S61>/E' |
| 27138 | * Constant: '<S61>/IV' |
| 27139 | * Switch: '<S63>/Switch1' |
| 27140 | */ |
| 27141 | if (L4_MABX_B.Unit_Delay_mw) { |
| 27142 | L4_MABX_B.Switch1_h = L4_MABX_P.IV_Value_ey; |
| 27143 | } else { |
| 27144 | if (L4_MABX_P.E_Value_c) { |
| 27145 | /* Sum: '<S61>/Subtract' incorporates: |
| 27146 | * Constant: '<S61>/Constant' |
| 27147 | * Switch: '<S63>/Switch1' |
| 27148 | */ |
| 27149 | q0 = L4_MABX_P.Constant_Value_iu; |
| 27150 | qY = q0 + L4_MABX_B.UnitDelay_a; |
| 27151 | if (qY < q0) { |
| 27152 | qY = MAX_uint32_T; |
| 27153 | } |
| 27154 | |
| 27155 | L4_MABX_B.Subtract_fc = qY; |
| 27156 | |
| 27157 | /* End of Sum: '<S61>/Subtract' */ |
| 27158 | |
| 27159 | /* Switch: '<S63>/Switch1' */ |
| 27160 | L4_MABX_B.Switch1_bs = L4_MABX_B.Subtract_fc; |
| 27161 | } else { |
| 27162 | /* Switch: '<S63>/Switch1' */ |
| 27163 | L4_MABX_B.Switch1_bs = L4_MABX_B.UnitDelay_a; |
| 27164 | } |
| 27165 | |
| 27166 | L4_MABX_B.Switch1_h = L4_MABX_B.Switch1_bs; |
| 27167 | } |
| 27168 | |
| 27169 | /* End of Switch: '<S64>/Switch1' */ |
| 27170 | |
| 27171 | /* Selector: '<S60>/Selector' */ |
| 27172 | L4_MABX_B.Selector_h = L4_MABX_B.Reshape_j[(int32_T)L4_MABX_B.Switch1_h - 1]; |
| 27173 | |
| 27174 | /* Outputs for Triggered SubSystem: '<S16>/CAN_TYPE1_BOR_M3_C2' incorporates: |
| 27175 | * TriggerPort: '<S59>/Trigger' |
| 27176 | */ |
| 27177 | zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C2_Trig_ZCE == POS_ZCSIG) != |
| 27178 | (int32_T)L4_MABX_B.Selector_h) && |
| 27179 | (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C2_Trig_ZCE != |
| 27180 | UNINITIALIZED_ZCSIG)); |
| 27181 | if (zcEvent) { |
| 27182 | /* S-Function (rti_commonblock): '<S59>/S-Function1' */ |
| 27183 | /* This comment workarounds a code generation problem */ |
| 27184 | |
| 27185 | /* dSPACE RTICAN Bus Off Recovery block */ |
| 27186 | /* ... Perform software-reset of the CAN microcontroller */ |
| 27187 | { |
| 27188 | UInt32 loop_counter, memory; |
| 27189 | loop_counter = 0; |
| 27190 | while ((rtican_type1_tq_error[2][0] = can_tp1_channel_BOff_return |
| 27191 | (can_type1_channel_M3_C2)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27192 | loop_counter++; |
| 27193 | if (loop_counter > MAX_LOOP) { |
| 27194 | memory = rtican_type1_error_level; |
| 27195 | rtican_type1_error_level = 1; |
| 27196 | rtican_type1_tq_err_sig(2, 0); |
| 27197 | rtican_type1_error_level = memory; |
| 27198 | break; |
| 27199 | } |
| 27200 | } |
| 27201 | |
| 27202 | while ((rtican_type1_tq_error[2][0] = can_tp1_channel_all_wakeup |
| 27203 | (can_type1_channel_M3_C2)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27204 | loop_counter++; |
| 27205 | if (loop_counter > MAX_LOOP) { |
| 27206 | memory = rtican_type1_error_level; |
| 27207 | rtican_type1_error_level = 1; |
| 27208 | rtican_type1_tq_err_sig(2, 0); |
| 27209 | rtican_type1_error_level = memory; |
| 27210 | break; |
| 27211 | } |
| 27212 | } |
| 27213 | } |
| 27214 | } |
| 27215 | |
| 27216 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C2_Trig_ZCE = L4_MABX_B.Selector_h; |
| 27217 | |
| 27218 | /* End of Outputs for SubSystem: '<S16>/CAN_TYPE1_BOR_M3_C2' */ |
| 27219 | |
| 27220 | /* RelationalOperator: '<S62>/Operator' */ |
| 27221 | L4_MABX_B.Operator_bg = (L4_MABX_B.Switch1_h == L4_MABX_ConstB.Width); |
| 27222 | } |
| 27223 | |
| 27224 | /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_6' */ |
| 27225 | |
| 27226 | /* S-Function (rti_commonblock): '<S18>/S-Function1' */ |
| 27227 | /* This comment workarounds a code generation problem */ |
| 27228 | |
| 27229 | /* dSPACE RTICAN Status block */ |
| 27230 | /* ... read status variables of the CAN microcontroller */ |
| 27231 | { |
| 27232 | UInt32 loop_counter, memory, j; |
| 27233 | for (j=0;j<=9;j++) { |
| 27234 | rtican_type1_tq_error[1][6] = can_tp1_service_read |
| 27235 | (can_type1_service_M2_C1[j]); |
| 27236 | loop_counter = 0; |
| 27237 | while ((rtican_type1_tq_error[1][6] = can_tp1_service_request |
| 27238 | (can_type1_service_M2_C1[j]))== DSMCOM_BUFFER_OVERFLOW) { |
| 27239 | loop_counter++; |
| 27240 | if (loop_counter > MAX_LOOP) { |
| 27241 | memory = rtican_type1_error_level; |
| 27242 | rtican_type1_error_level = 1; |
| 27243 | rtican_type1_tq_err_sig(1, 6); |
| 27244 | rtican_type1_error_level = memory; |
| 27245 | break; |
| 27246 | } |
| 27247 | } |
| 27248 | |
| 27249 | if (j==CANTP1_M2_C1_RXLost) { |
| 27250 | rtican_type1_tq_error[1][6] = can_tp1_service_read |
| 27251 | (can_type1_service_M2_C1[CANTP1_M2_C1_DataLost]); |
| 27252 | loop_counter = 0; |
| 27253 | while ((rtican_type1_tq_error[1][6] = can_tp1_service_request |
| 27254 | (can_type1_service_M2_C1[CANTP1_M2_C1_DataLost]))== |
| 27255 | DSMCOM_BUFFER_OVERFLOW) { |
| 27256 | loop_counter++; |
| 27257 | if (loop_counter > MAX_LOOP) { |
| 27258 | memory = rtican_type1_error_level; |
| 27259 | rtican_type1_error_level = 1; |
| 27260 | rtican_type1_tq_err_sig(1, 6); |
| 27261 | rtican_type1_error_level = memory; |
| 27262 | break; |
| 27263 | } |
| 27264 | } |
| 27265 | } |
| 27266 | } |
| 27267 | |
| 27268 | L4_MABX_B.SFunction1_o1_h4 = (UInt32) |
| 27269 | can_type1_service_M2_C1[CANTP1_M2_C1_Status]->data0; |
| 27270 | DIAG_CAN3_Count_Stuff_Errors = (UInt32) |
| 27271 | can_type1_service_M2_C1[CANTP1_M2_C1_StuffErrors]->data0; |
| 27272 | DIAG_CAN3_Count_Format_Errors = (UInt32) |
| 27273 | can_type1_service_M2_C1[CANTP1_M2_C1_FormatErrors]->data0; |
| 27274 | DIAG_CAN3_Count_Ack_Errors = (UInt32) |
| 27275 | can_type1_service_M2_C1[CANTP1_M2_C1_AckErrors]->data0; |
| 27276 | DIAG_CAN3_Count_Bit0_Errors = (UInt32) |
| 27277 | can_type1_service_M2_C1[CANTP1_M2_C1_Bit0Errors]->data0; |
| 27278 | DIAG_CAN3_Count_Bit1_Errors = (UInt32) |
| 27279 | can_type1_service_M2_C1[CANTP1_M2_C1_Bit1Errors]->data0; |
| 27280 | DIAG_CAN3_Count_CRC_Errors = (UInt32) |
| 27281 | can_type1_service_M2_C1[CANTP1_M2_C1_CRCErrors]->data0; |
| 27282 | DIAG_CAN3_Count_RX_Lost = (UInt32) |
| 27283 | (can_type1_service_M2_C1[CANTP1_M2_C1_RXLost]->data0 + |
| 27284 | can_type1_service_M2_C1[CANTP1_M2_C1_DataLost]->data0); |
| 27285 | DIAG_CAN3_Count_RX_OK = (UInt32) can_type1_service_M2_C1[CANTP1_M2_C1_RXOK |
| 27286 | ]->data0; |
| 27287 | DIAG_CAN3_Count_TX_OK = (UInt32) can_type1_service_M2_C1[CANTP1_M2_C1_TXOK |
| 27288 | ]->data0; |
| 27289 | } |
| 27290 | |
| 27291 | /* DataTypeConversion: '<S1>/Data Type Conversion3' */ |
| 27292 | DIAG_CAN3_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI |
| 27293 | ((int32_T)L4_MABX_B.SFunction1_o1_h4); |
| 27294 | |
| 27295 | /* RelationalOperator: '<S24>/Operator' incorporates: |
| 27296 | * Constant: '<S1>/Constant1' |
| 27297 | */ |
| 27298 | L4_MABX_B.Operator_bs = (L4_MABX_P.Constant1_Value_c0 == DIAG_CAN3_Status); |
| 27299 | |
| 27300 | /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_3' incorporates: |
| 27301 | * EnablePort: '<S13>/Enable' |
| 27302 | */ |
| 27303 | if (L4_MABX_B.Operator_bs) { |
| 27304 | /* Reshape: '<S42>/Reshape' incorporates: |
| 27305 | * Constant: '<S42>/Constant' |
| 27306 | */ |
| 27307 | L4_MABX_B.Reshape_iq[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_o[0]; |
| 27308 | L4_MABX_B.Reshape_iq[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_o[1]; |
| 27309 | |
| 27310 | /* UnitDelay: '<S42>/Unit_Delay' */ |
| 27311 | L4_MABX_B.Unit_Delay_m0 = L4_MABX_DW.Unit_Delay_DSTATE_h41; |
| 27312 | |
| 27313 | /* UnitDelay: '<S43>/Unit Delay' */ |
| 27314 | L4_MABX_B.UnitDelay_d = L4_MABX_DW.UnitDelay_DSTATE_dr4; |
| 27315 | |
| 27316 | /* Switch: '<S46>/Switch1' incorporates: |
| 27317 | * Constant: '<S43>/E' |
| 27318 | * Constant: '<S43>/IV' |
| 27319 | * Switch: '<S45>/Switch1' |
| 27320 | */ |
| 27321 | if (L4_MABX_B.Unit_Delay_m0) { |
| 27322 | L4_MABX_B.Switch1_k4 = L4_MABX_P.IV_Value_b; |
| 27323 | } else { |
| 27324 | if (L4_MABX_P.E_Value_d) { |
| 27325 | /* Sum: '<S43>/Subtract' incorporates: |
| 27326 | * Constant: '<S43>/Constant' |
| 27327 | * Switch: '<S45>/Switch1' |
| 27328 | */ |
| 27329 | q0 = L4_MABX_P.Constant_Value_h3; |
| 27330 | qY = q0 + L4_MABX_B.UnitDelay_d; |
| 27331 | if (qY < q0) { |
| 27332 | qY = MAX_uint32_T; |
| 27333 | } |
| 27334 | |
| 27335 | L4_MABX_B.Subtract_h1 = qY; |
| 27336 | |
| 27337 | /* End of Sum: '<S43>/Subtract' */ |
| 27338 | |
| 27339 | /* Switch: '<S45>/Switch1' */ |
| 27340 | L4_MABX_B.Switch1_fr = L4_MABX_B.Subtract_h1; |
| 27341 | } else { |
| 27342 | /* Switch: '<S45>/Switch1' */ |
| 27343 | L4_MABX_B.Switch1_fr = L4_MABX_B.UnitDelay_d; |
| 27344 | } |
| 27345 | |
| 27346 | L4_MABX_B.Switch1_k4 = L4_MABX_B.Switch1_fr; |
| 27347 | } |
| 27348 | |
| 27349 | /* End of Switch: '<S46>/Switch1' */ |
| 27350 | |
| 27351 | /* Selector: '<S42>/Selector' */ |
| 27352 | L4_MABX_B.Selector_g = L4_MABX_B.Reshape_iq[(int32_T)L4_MABX_B.Switch1_k4 - |
| 27353 | 1]; |
| 27354 | |
| 27355 | /* Outputs for Triggered SubSystem: '<S13>/CAN_TYPE1_BOR_M2_C1' incorporates: |
| 27356 | * TriggerPort: '<S41>/Trigger' |
| 27357 | */ |
| 27358 | zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C1_Trig_ZCE == POS_ZCSIG) != |
| 27359 | (int32_T)L4_MABX_B.Selector_g) && |
| 27360 | (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C1_Trig_ZCE != |
| 27361 | UNINITIALIZED_ZCSIG)); |
| 27362 | if (zcEvent) { |
| 27363 | /* S-Function (rti_commonblock): '<S41>/S-Function1' */ |
| 27364 | /* This comment workarounds a code generation problem */ |
| 27365 | |
| 27366 | /* dSPACE RTICAN Bus Off Recovery block */ |
| 27367 | /* ... Perform software-reset of the CAN microcontroller */ |
| 27368 | { |
| 27369 | UInt32 loop_counter, memory; |
| 27370 | loop_counter = 0; |
| 27371 | while ((rtican_type1_tq_error[1][0] = can_tp1_channel_BOff_return |
| 27372 | (can_type1_channel_M2_C1)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27373 | loop_counter++; |
| 27374 | if (loop_counter > MAX_LOOP) { |
| 27375 | memory = rtican_type1_error_level; |
| 27376 | rtican_type1_error_level = 1; |
| 27377 | rtican_type1_tq_err_sig(1, 0); |
| 27378 | rtican_type1_error_level = memory; |
| 27379 | break; |
| 27380 | } |
| 27381 | } |
| 27382 | |
| 27383 | while ((rtican_type1_tq_error[1][0] = can_tp1_channel_all_wakeup |
| 27384 | (can_type1_channel_M2_C1)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27385 | loop_counter++; |
| 27386 | if (loop_counter > MAX_LOOP) { |
| 27387 | memory = rtican_type1_error_level; |
| 27388 | rtican_type1_error_level = 1; |
| 27389 | rtican_type1_tq_err_sig(1, 0); |
| 27390 | rtican_type1_error_level = memory; |
| 27391 | break; |
| 27392 | } |
| 27393 | } |
| 27394 | } |
| 27395 | } |
| 27396 | |
| 27397 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C1_Trig_ZCE = L4_MABX_B.Selector_g; |
| 27398 | |
| 27399 | /* End of Outputs for SubSystem: '<S13>/CAN_TYPE1_BOR_M2_C1' */ |
| 27400 | |
| 27401 | /* RelationalOperator: '<S44>/Operator' */ |
| 27402 | L4_MABX_B.Operator_dhn = (L4_MABX_B.Switch1_k4 == L4_MABX_ConstB.Width_iw); |
| 27403 | } |
| 27404 | |
| 27405 | /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_3' */ |
| 27406 | |
| 27407 | /* S-Function (rti_commonblock): '<S19>/S-Function1' */ |
| 27408 | /* This comment workarounds a code generation problem */ |
| 27409 | |
| 27410 | /* dSPACE RTICAN Status block */ |
| 27411 | /* ... read status variables of the CAN microcontroller */ |
| 27412 | { |
| 27413 | UInt32 loop_counter, memory, j; |
| 27414 | for (j=0;j<=9;j++) { |
| 27415 | rtican_type1_tq_error[1][6] = can_tp1_service_read |
| 27416 | (can_type1_service_M2_C2[j]); |
| 27417 | loop_counter = 0; |
| 27418 | while ((rtican_type1_tq_error[1][6] = can_tp1_service_request |
| 27419 | (can_type1_service_M2_C2[j]))== DSMCOM_BUFFER_OVERFLOW) { |
| 27420 | loop_counter++; |
| 27421 | if (loop_counter > MAX_LOOP) { |
| 27422 | memory = rtican_type1_error_level; |
| 27423 | rtican_type1_error_level = 1; |
| 27424 | rtican_type1_tq_err_sig(1, 6); |
| 27425 | rtican_type1_error_level = memory; |
| 27426 | break; |
| 27427 | } |
| 27428 | } |
| 27429 | |
| 27430 | if (j==CANTP1_M2_C2_RXLost) { |
| 27431 | rtican_type1_tq_error[1][6] = can_tp1_service_read |
| 27432 | (can_type1_service_M2_C2[CANTP1_M2_C2_DataLost]); |
| 27433 | loop_counter = 0; |
| 27434 | while ((rtican_type1_tq_error[1][6] = can_tp1_service_request |
| 27435 | (can_type1_service_M2_C2[CANTP1_M2_C2_DataLost]))== |
| 27436 | DSMCOM_BUFFER_OVERFLOW) { |
| 27437 | loop_counter++; |
| 27438 | if (loop_counter > MAX_LOOP) { |
| 27439 | memory = rtican_type1_error_level; |
| 27440 | rtican_type1_error_level = 1; |
| 27441 | rtican_type1_tq_err_sig(1, 6); |
| 27442 | rtican_type1_error_level = memory; |
| 27443 | break; |
| 27444 | } |
| 27445 | } |
| 27446 | } |
| 27447 | } |
| 27448 | |
| 27449 | L4_MABX_B.SFunction1_o1_mah = (UInt32) |
| 27450 | can_type1_service_M2_C2[CANTP1_M2_C2_Status]->data0; |
| 27451 | DIAG_CAN4_Count_Stuff_Errors = (UInt32) |
| 27452 | can_type1_service_M2_C2[CANTP1_M2_C2_StuffErrors]->data0; |
| 27453 | DIAG_CAN4_Count_Format_Errors = (UInt32) |
| 27454 | can_type1_service_M2_C2[CANTP1_M2_C2_FormatErrors]->data0; |
| 27455 | DIAG_CAN4_Count_Ack_Errors = (UInt32) |
| 27456 | can_type1_service_M2_C2[CANTP1_M2_C2_AckErrors]->data0; |
| 27457 | DIAG_CAN4_Count_Bit0_Errors = (UInt32) |
| 27458 | can_type1_service_M2_C2[CANTP1_M2_C2_Bit0Errors]->data0; |
| 27459 | DIAG_CAN4_Count_Bit1_Errors = (UInt32) |
| 27460 | can_type1_service_M2_C2[CANTP1_M2_C2_Bit1Errors]->data0; |
| 27461 | DIAG_CAN4_Count_CRC_Errors = (UInt32) |
| 27462 | can_type1_service_M2_C2[CANTP1_M2_C2_CRCErrors]->data0; |
| 27463 | DIAG_CAN4_Count_RX_Lost = (UInt32) |
| 27464 | (can_type1_service_M2_C2[CANTP1_M2_C2_RXLost]->data0 + |
| 27465 | can_type1_service_M2_C2[CANTP1_M2_C2_DataLost]->data0); |
| 27466 | DIAG_CAN4_Count_RX_OK = (UInt32) can_type1_service_M2_C2[CANTP1_M2_C2_RXOK |
| 27467 | ]->data0; |
| 27468 | DIAG_CAN4_Count_TX_OK = (UInt32) can_type1_service_M2_C2[CANTP1_M2_C2_TXOK |
| 27469 | ]->data0; |
| 27470 | } |
| 27471 | |
| 27472 | /* DataTypeConversion: '<S1>/Data Type Conversion2' */ |
| 27473 | DIAG_CAN4_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI |
| 27474 | ((int32_T)L4_MABX_B.SFunction1_o1_mah); |
| 27475 | |
| 27476 | /* RelationalOperator: '<S25>/Operator' incorporates: |
| 27477 | * Constant: '<S1>/Constant3' |
| 27478 | */ |
| 27479 | L4_MABX_B.Operator_bw = (L4_MABX_P.Constant3_Value_hq == DIAG_CAN4_Status); |
| 27480 | |
| 27481 | /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_4' incorporates: |
| 27482 | * EnablePort: '<S14>/Enable' |
| 27483 | */ |
| 27484 | if (L4_MABX_B.Operator_bw) { |
| 27485 | /* Reshape: '<S48>/Reshape' incorporates: |
| 27486 | * Constant: '<S48>/Constant' |
| 27487 | */ |
| 27488 | L4_MABX_B.Reshape_n[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_n[0]; |
| 27489 | L4_MABX_B.Reshape_n[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_n[1]; |
| 27490 | |
| 27491 | /* UnitDelay: '<S48>/Unit_Delay' */ |
| 27492 | L4_MABX_B.Unit_Delay_fl = L4_MABX_DW.Unit_Delay_DSTATE_mq; |
| 27493 | |
| 27494 | /* UnitDelay: '<S49>/Unit Delay' */ |
| 27495 | L4_MABX_B.UnitDelay_l = L4_MABX_DW.UnitDelay_DSTATE_h; |
| 27496 | |
| 27497 | /* Switch: '<S52>/Switch1' incorporates: |
| 27498 | * Constant: '<S49>/E' |
| 27499 | * Constant: '<S49>/IV' |
| 27500 | * Switch: '<S51>/Switch1' |
| 27501 | */ |
| 27502 | if (L4_MABX_B.Unit_Delay_fl) { |
| 27503 | L4_MABX_B.Switch1_e = L4_MABX_P.IV_Value_k; |
| 27504 | } else { |
| 27505 | if (L4_MABX_P.E_Value_m) { |
| 27506 | /* Sum: '<S49>/Subtract' incorporates: |
| 27507 | * Constant: '<S49>/Constant' |
| 27508 | * Switch: '<S51>/Switch1' |
| 27509 | */ |
| 27510 | q0 = L4_MABX_P.Constant_Value_o0; |
| 27511 | qY = q0 + L4_MABX_B.UnitDelay_l; |
| 27512 | if (qY < q0) { |
| 27513 | qY = MAX_uint32_T; |
| 27514 | } |
| 27515 | |
| 27516 | L4_MABX_B.Subtract_f1 = qY; |
| 27517 | |
| 27518 | /* End of Sum: '<S49>/Subtract' */ |
| 27519 | |
| 27520 | /* Switch: '<S51>/Switch1' */ |
| 27521 | L4_MABX_B.Switch1_c = L4_MABX_B.Subtract_f1; |
| 27522 | } else { |
| 27523 | /* Switch: '<S51>/Switch1' */ |
| 27524 | L4_MABX_B.Switch1_c = L4_MABX_B.UnitDelay_l; |
| 27525 | } |
| 27526 | |
| 27527 | L4_MABX_B.Switch1_e = L4_MABX_B.Switch1_c; |
| 27528 | } |
| 27529 | |
| 27530 | /* End of Switch: '<S52>/Switch1' */ |
| 27531 | |
| 27532 | /* Selector: '<S48>/Selector' */ |
| 27533 | L4_MABX_B.Selector_i = L4_MABX_B.Reshape_n[(int32_T)L4_MABX_B.Switch1_e - 1]; |
| 27534 | |
| 27535 | /* Outputs for Triggered SubSystem: '<S14>/CAN_TYPE1_BOR_M2_C2' incorporates: |
| 27536 | * TriggerPort: '<S47>/Trigger' |
| 27537 | */ |
| 27538 | zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C2_Trig_ZCE == POS_ZCSIG) != |
| 27539 | (int32_T)L4_MABX_B.Selector_i) && |
| 27540 | (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C2_Trig_ZCE != |
| 27541 | UNINITIALIZED_ZCSIG)); |
| 27542 | if (zcEvent) { |
| 27543 | /* S-Function (rti_commonblock): '<S47>/S-Function1' */ |
| 27544 | /* This comment workarounds a code generation problem */ |
| 27545 | |
| 27546 | /* dSPACE RTICAN Bus Off Recovery block */ |
| 27547 | /* ... Perform software-reset of the CAN microcontroller */ |
| 27548 | { |
| 27549 | UInt32 loop_counter, memory; |
| 27550 | loop_counter = 0; |
| 27551 | while ((rtican_type1_tq_error[1][0] = can_tp1_channel_BOff_return |
| 27552 | (can_type1_channel_M2_C2)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27553 | loop_counter++; |
| 27554 | if (loop_counter > MAX_LOOP) { |
| 27555 | memory = rtican_type1_error_level; |
| 27556 | rtican_type1_error_level = 1; |
| 27557 | rtican_type1_tq_err_sig(1, 0); |
| 27558 | rtican_type1_error_level = memory; |
| 27559 | break; |
| 27560 | } |
| 27561 | } |
| 27562 | |
| 27563 | while ((rtican_type1_tq_error[1][0] = can_tp1_channel_all_wakeup |
| 27564 | (can_type1_channel_M2_C2)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27565 | loop_counter++; |
| 27566 | if (loop_counter > MAX_LOOP) { |
| 27567 | memory = rtican_type1_error_level; |
| 27568 | rtican_type1_error_level = 1; |
| 27569 | rtican_type1_tq_err_sig(1, 0); |
| 27570 | rtican_type1_error_level = memory; |
| 27571 | break; |
| 27572 | } |
| 27573 | } |
| 27574 | } |
| 27575 | } |
| 27576 | |
| 27577 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C2_Trig_ZCE = L4_MABX_B.Selector_i; |
| 27578 | |
| 27579 | /* End of Outputs for SubSystem: '<S14>/CAN_TYPE1_BOR_M2_C2' */ |
| 27580 | |
| 27581 | /* RelationalOperator: '<S50>/Operator' */ |
| 27582 | L4_MABX_B.Operator_ou = (L4_MABX_B.Switch1_e == L4_MABX_ConstB.Width_i); |
| 27583 | } |
| 27584 | |
| 27585 | /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_4' */ |
| 27586 | |
| 27587 | /* S-Function (rti_commonblock): '<S17>/S-Function1' */ |
| 27588 | /* This comment workarounds a code generation problem */ |
| 27589 | |
| 27590 | /* dSPACE RTICAN Status block */ |
| 27591 | /* ... read status variables of the CAN microcontroller */ |
| 27592 | { |
| 27593 | UInt32 loop_counter, memory, j; |
| 27594 | for (j=0;j<=9;j++) { |
| 27595 | rtican_type1_tq_error[0][6] = can_tp1_service_read |
| 27596 | (can_type1_service_M1_C2[j]); |
| 27597 | loop_counter = 0; |
| 27598 | while ((rtican_type1_tq_error[0][6] = can_tp1_service_request |
| 27599 | (can_type1_service_M1_C2[j]))== DSMCOM_BUFFER_OVERFLOW) { |
| 27600 | loop_counter++; |
| 27601 | if (loop_counter > MAX_LOOP) { |
| 27602 | memory = rtican_type1_error_level; |
| 27603 | rtican_type1_error_level = 1; |
| 27604 | rtican_type1_tq_err_sig(0, 6); |
| 27605 | rtican_type1_error_level = memory; |
| 27606 | break; |
| 27607 | } |
| 27608 | } |
| 27609 | |
| 27610 | if (j==CANTP1_M1_C2_RXLost) { |
| 27611 | rtican_type1_tq_error[0][6] = can_tp1_service_read |
| 27612 | (can_type1_service_M1_C2[CANTP1_M1_C2_DataLost]); |
| 27613 | loop_counter = 0; |
| 27614 | while ((rtican_type1_tq_error[0][6] = can_tp1_service_request |
| 27615 | (can_type1_service_M1_C2[CANTP1_M1_C2_DataLost]))== |
| 27616 | DSMCOM_BUFFER_OVERFLOW) { |
| 27617 | loop_counter++; |
| 27618 | if (loop_counter > MAX_LOOP) { |
| 27619 | memory = rtican_type1_error_level; |
| 27620 | rtican_type1_error_level = 1; |
| 27621 | rtican_type1_tq_err_sig(0, 6); |
| 27622 | rtican_type1_error_level = memory; |
| 27623 | break; |
| 27624 | } |
| 27625 | } |
| 27626 | } |
| 27627 | } |
| 27628 | |
| 27629 | L4_MABX_B.SFunction1_o1_og = (UInt32) |
| 27630 | can_type1_service_M1_C2[CANTP1_M1_C2_Status]->data0; |
| 27631 | DIAG_CAN2_Count_Stuff_Errors = (UInt32) |
| 27632 | can_type1_service_M1_C2[CANTP1_M1_C2_StuffErrors]->data0; |
| 27633 | DIAG_CAN2_Count_Format_Errors = (UInt32) |
| 27634 | can_type1_service_M1_C2[CANTP1_M1_C2_FormatErrors]->data0; |
| 27635 | DIAG_CAN2_Count_Ack_Errors = (UInt32) |
| 27636 | can_type1_service_M1_C2[CANTP1_M1_C2_AckErrors]->data0; |
| 27637 | DIAG_CAN2_Count_Bit0_Errors = (UInt32) |
| 27638 | can_type1_service_M1_C2[CANTP1_M1_C2_Bit0Errors]->data0; |
| 27639 | DIAG_CAN2_Count_Bit1_Errors = (UInt32) |
| 27640 | can_type1_service_M1_C2[CANTP1_M1_C2_Bit1Errors]->data0; |
| 27641 | DIAG_CAN2_Count_CRC_Errors = (UInt32) |
| 27642 | can_type1_service_M1_C2[CANTP1_M1_C2_CRCErrors]->data0; |
| 27643 | DIAG_CAN2_Count_RX_Lost = (UInt32) |
| 27644 | (can_type1_service_M1_C2[CANTP1_M1_C2_RXLost]->data0 + |
| 27645 | can_type1_service_M1_C2[CANTP1_M1_C2_DataLost]->data0); |
| 27646 | DIAG_CAN2_Count_RX_OK = (UInt32) can_type1_service_M1_C2[CANTP1_M1_C2_RXOK |
| 27647 | ]->data0; |
| 27648 | DIAG_CAN2_Count_TX_OK = (UInt32) can_type1_service_M1_C2[CANTP1_M1_C2_TXOK |
| 27649 | ]->data0; |
| 27650 | } |
| 27651 | |
| 27652 | /* DataTypeConversion: '<S1>/Data Type Conversion1' */ |
| 27653 | DIAG_CAN2_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI |
| 27654 | ((int32_T)L4_MABX_B.SFunction1_o1_og); |
| 27655 | |
| 27656 | /* RelationalOperator: '<S23>/Operator' incorporates: |
| 27657 | * Constant: '<S1>/Constant2' |
| 27658 | */ |
| 27659 | L4_MABX_B.Operator_eb = (L4_MABX_P.Constant2_Value_j == DIAG_CAN2_Status); |
| 27660 | |
| 27661 | /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_2' incorporates: |
| 27662 | * EnablePort: '<S12>/Enable' |
| 27663 | */ |
| 27664 | if (L4_MABX_B.Operator_eb) { |
| 27665 | /* Reshape: '<S36>/Reshape' incorporates: |
| 27666 | * Constant: '<S36>/Constant' |
| 27667 | */ |
| 27668 | L4_MABX_B.Reshape_a5[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_d[0]; |
| 27669 | L4_MABX_B.Reshape_a5[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_d[1]; |
| 27670 | |
| 27671 | /* UnitDelay: '<S36>/Unit_Delay' */ |
| 27672 | L4_MABX_B.Unit_Delay_g1 = L4_MABX_DW.Unit_Delay_DSTATE_je; |
| 27673 | |
| 27674 | /* UnitDelay: '<S37>/Unit Delay' */ |
| 27675 | L4_MABX_B.UnitDelay_b = L4_MABX_DW.UnitDelay_DSTATE_bv; |
| 27676 | |
| 27677 | /* Switch: '<S40>/Switch1' incorporates: |
| 27678 | * Constant: '<S37>/E' |
| 27679 | * Constant: '<S37>/IV' |
| 27680 | * Switch: '<S39>/Switch1' |
| 27681 | */ |
| 27682 | if (L4_MABX_B.Unit_Delay_g1) { |
| 27683 | L4_MABX_B.Switch1_i = L4_MABX_P.IV_Value_e; |
| 27684 | } else { |
| 27685 | if (L4_MABX_P.E_Value_l) { |
| 27686 | /* Sum: '<S37>/Subtract' incorporates: |
| 27687 | * Constant: '<S37>/Constant' |
| 27688 | * Switch: '<S39>/Switch1' |
| 27689 | */ |
| 27690 | q0 = L4_MABX_P.Constant_Value_ae; |
| 27691 | qY = q0 + L4_MABX_B.UnitDelay_b; |
| 27692 | if (qY < q0) { |
| 27693 | qY = MAX_uint32_T; |
| 27694 | } |
| 27695 | |
| 27696 | L4_MABX_B.Subtract_nc = qY; |
| 27697 | |
| 27698 | /* End of Sum: '<S37>/Subtract' */ |
| 27699 | |
| 27700 | /* Switch: '<S39>/Switch1' */ |
| 27701 | L4_MABX_B.Switch1_hm = L4_MABX_B.Subtract_nc; |
| 27702 | } else { |
| 27703 | /* Switch: '<S39>/Switch1' */ |
| 27704 | L4_MABX_B.Switch1_hm = L4_MABX_B.UnitDelay_b; |
| 27705 | } |
| 27706 | |
| 27707 | L4_MABX_B.Switch1_i = L4_MABX_B.Switch1_hm; |
| 27708 | } |
| 27709 | |
| 27710 | /* End of Switch: '<S40>/Switch1' */ |
| 27711 | |
| 27712 | /* Selector: '<S36>/Selector' */ |
| 27713 | L4_MABX_B.Selector_b = L4_MABX_B.Reshape_a5[(int32_T)L4_MABX_B.Switch1_i - 1]; |
| 27714 | |
| 27715 | /* Outputs for Triggered SubSystem: '<S12>/CAN_TYPE1_BOR_M1_C2' incorporates: |
| 27716 | * TriggerPort: '<S35>/Trigger' |
| 27717 | */ |
| 27718 | zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C2_Trig_ZCE == POS_ZCSIG) != |
| 27719 | (int32_T)L4_MABX_B.Selector_b) && |
| 27720 | (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C2_Trig_ZCE != |
| 27721 | UNINITIALIZED_ZCSIG)); |
| 27722 | if (zcEvent) { |
| 27723 | /* S-Function (rti_commonblock): '<S35>/S-Function1' */ |
| 27724 | /* This comment workarounds a code generation problem */ |
| 27725 | |
| 27726 | /* dSPACE RTICAN Bus Off Recovery block */ |
| 27727 | /* ... Perform software-reset of the CAN microcontroller */ |
| 27728 | { |
| 27729 | UInt32 loop_counter, memory; |
| 27730 | loop_counter = 0; |
| 27731 | while ((rtican_type1_tq_error[0][0] = can_tp1_channel_BOff_return |
| 27732 | (can_type1_channel_M1_C2)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27733 | loop_counter++; |
| 27734 | if (loop_counter > MAX_LOOP) { |
| 27735 | memory = rtican_type1_error_level; |
| 27736 | rtican_type1_error_level = 1; |
| 27737 | rtican_type1_tq_err_sig(0, 0); |
| 27738 | rtican_type1_error_level = memory; |
| 27739 | break; |
| 27740 | } |
| 27741 | } |
| 27742 | |
| 27743 | while ((rtican_type1_tq_error[0][0] = can_tp1_channel_all_wakeup |
| 27744 | (can_type1_channel_M1_C2)) == DSMCOM_BUFFER_OVERFLOW) { |
| 27745 | loop_counter++; |
| 27746 | if (loop_counter > MAX_LOOP) { |
| 27747 | memory = rtican_type1_error_level; |
| 27748 | rtican_type1_error_level = 1; |
| 27749 | rtican_type1_tq_err_sig(0, 0); |
| 27750 | rtican_type1_error_level = memory; |
| 27751 | break; |
| 27752 | } |
| 27753 | } |
| 27754 | } |
| 27755 | } |
| 27756 | |
| 27757 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C2_Trig_ZCE = L4_MABX_B.Selector_b; |
| 27758 | |
| 27759 | /* End of Outputs for SubSystem: '<S12>/CAN_TYPE1_BOR_M1_C2' */ |
| 27760 | |
| 27761 | /* RelationalOperator: '<S38>/Operator' */ |
| 27762 | L4_MABX_B.Operator_bsv = (L4_MABX_B.Switch1_i == L4_MABX_ConstB.Width_g); |
| 27763 | } |
| 27764 | |
| 27765 | /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_2' */ |
| 27766 | /* user code (Output function Trailer for TID5) */ |
| 27767 | |
| 27768 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 27769 | /* EventChannel: 0 */ |
| 27770 | if (tid == 0) { |
| 27771 | DSXCP_service(0); |
| 27772 | } |
| 27773 | |
| 27774 | /* If subsystem generates rate grouping Output functions, |
| 27775 | * when tid is used in Output function for one rate, |
| 27776 | * all Output functions include tid as a local variable. |
| 27777 | * As result, some Output functions may have unused tid. |
| 27778 | */ |
| 27779 | UNUSED_PARAMETER(tid); |
| 27780 | } |
| 27781 | |
| 27782 | /* Model update function for TID5 */ |
| 27783 | void L4_MABX_update5(void) /* Sample time: [0.5s, 0.0s] */ |
| 27784 | { |
| 27785 | /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_1' incorporates: |
| 27786 | * EnablePort: '<S11>/Enable' |
| 27787 | */ |
| 27788 | if (L4_MABX_B.Operator_eu) { |
| 27789 | /* Update for UnitDelay: '<S30>/Unit_Delay' */ |
| 27790 | L4_MABX_DW.Unit_Delay_DSTATE_f1 = L4_MABX_B.Operator_f5; |
| 27791 | |
| 27792 | /* Update for UnitDelay: '<S31>/Unit Delay' */ |
| 27793 | L4_MABX_DW.UnitDelay_DSTATE_j = L4_MABX_B.Switch1_o0; |
| 27794 | } |
| 27795 | |
| 27796 | /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_1' */ |
| 27797 | |
| 27798 | /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_5' incorporates: |
| 27799 | * EnablePort: '<S15>/Enable' |
| 27800 | */ |
| 27801 | if (L4_MABX_B.Operator_ms) { |
| 27802 | /* Update for UnitDelay: '<S54>/Unit_Delay' */ |
| 27803 | L4_MABX_DW.Unit_Delay_DSTATE_i5y = L4_MABX_B.Operator_ho0; |
| 27804 | |
| 27805 | /* Update for UnitDelay: '<S55>/Unit Delay' */ |
| 27806 | L4_MABX_DW.UnitDelay_DSTATE_p = L4_MABX_B.Switch1_k; |
| 27807 | } |
| 27808 | |
| 27809 | /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_5' */ |
| 27810 | |
| 27811 | /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_6' incorporates: |
| 27812 | * EnablePort: '<S16>/Enable' |
| 27813 | */ |
| 27814 | if (L4_MABX_B.Operator_fve) { |
| 27815 | /* Update for UnitDelay: '<S60>/Unit_Delay' */ |
| 27816 | L4_MABX_DW.Unit_Delay_DSTATE_l5 = L4_MABX_B.Operator_bg; |
| 27817 | |
| 27818 | /* Update for UnitDelay: '<S61>/Unit Delay' */ |
| 27819 | L4_MABX_DW.UnitDelay_DSTATE_dr = L4_MABX_B.Switch1_h; |
| 27820 | } |
| 27821 | |
| 27822 | /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_6' */ |
| 27823 | |
| 27824 | /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_3' incorporates: |
| 27825 | * EnablePort: '<S13>/Enable' |
| 27826 | */ |
| 27827 | if (L4_MABX_B.Operator_bs) { |
| 27828 | /* Update for UnitDelay: '<S42>/Unit_Delay' */ |
| 27829 | L4_MABX_DW.Unit_Delay_DSTATE_h41 = L4_MABX_B.Operator_dhn; |
| 27830 | |
| 27831 | /* Update for UnitDelay: '<S43>/Unit Delay' */ |
| 27832 | L4_MABX_DW.UnitDelay_DSTATE_dr4 = L4_MABX_B.Switch1_k4; |
| 27833 | } |
| 27834 | |
| 27835 | /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_3' */ |
| 27836 | |
| 27837 | /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_4' incorporates: |
| 27838 | * EnablePort: '<S14>/Enable' |
| 27839 | */ |
| 27840 | if (L4_MABX_B.Operator_bw) { |
| 27841 | /* Update for UnitDelay: '<S48>/Unit_Delay' */ |
| 27842 | L4_MABX_DW.Unit_Delay_DSTATE_mq = L4_MABX_B.Operator_ou; |
| 27843 | |
| 27844 | /* Update for UnitDelay: '<S49>/Unit Delay' */ |
| 27845 | L4_MABX_DW.UnitDelay_DSTATE_h = L4_MABX_B.Switch1_e; |
| 27846 | } |
| 27847 | |
| 27848 | /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_4' */ |
| 27849 | |
| 27850 | /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_2' incorporates: |
| 27851 | * EnablePort: '<S12>/Enable' |
| 27852 | */ |
| 27853 | if (L4_MABX_B.Operator_eb) { |
| 27854 | /* Update for UnitDelay: '<S36>/Unit_Delay' */ |
| 27855 | L4_MABX_DW.Unit_Delay_DSTATE_je = L4_MABX_B.Operator_bsv; |
| 27856 | |
| 27857 | /* Update for UnitDelay: '<S37>/Unit Delay' */ |
| 27858 | L4_MABX_DW.UnitDelay_DSTATE_bv = L4_MABX_B.Switch1_i; |
| 27859 | } |
| 27860 | |
| 27861 | /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_2' */ |
| 27862 | } |
| 27863 | |
| 27864 | /* Model output function for TID6 */ |
| 27865 | void L4_MABX_output6(void) /* Sample time: [1.0s, 0.0s] */ |
| 27866 | { |
| 27867 | int_T tid = 6; |
| 27868 | |
| 27869 | /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_1000ms' */ |
| 27870 | |
| 27871 | /* DataTypeConversion: '<S861>/Data Type Conversion' incorporates: |
| 27872 | * Constant: '<S852>/Constant2' |
| 27873 | */ |
| 27874 | L4_MABX_B.DataTypeConversion_io = (uint8_T)L4_MABX_P.Constant2_Value_ki; |
| 27875 | |
| 27876 | /* S-Function (sfix_bitop): '<S866>/Operator' */ |
| 27877 | L4_MABX_B.Operator_lq = (uint8_T)(L4_MABX_B.DataTypeConversion_io & |
| 27878 | L4_MABX_P.Operator_BitMask); |
| 27879 | |
| 27880 | /* DataTypeConversion: '<S866>/DataType' */ |
| 27881 | L4_MABX_B.DataType_n4 = L4_MABX_B.Operator_lq; |
| 27882 | |
| 27883 | /* ArithShift: '<S861>/Shift_Arithmetic 2' */ |
| 27884 | L4_MABX_B.Shift_Arithmetic2_j = ldexp(L4_MABX_B.DataType_n4, (-3)); |
| 27885 | |
| 27886 | /* DataTypeConversion: '<S861>/Data Type Conversion5' */ |
| 27887 | L4_MABX_B.DataTypeConversion5_a1 = (L4_MABX_B.Shift_Arithmetic2_j != 0.0); |
| 27888 | |
| 27889 | /* Outputs for Enabled SubSystem: '<S869>/AIR1' incorporates: |
| 27890 | * EnablePort: '<S870>/Enable' |
| 27891 | */ |
| 27892 | if (L4_MABX_B.DataTypeConversion5_a1) { |
| 27893 | /* S-Function (rti_commonblock): '<S870>/S-Function1' */ |
| 27894 | /* This comment workarounds a code generation problem */ |
| 27895 | |
| 27896 | /* dSPACE RTICAN TX Message Block: "AIR1" Id:419343921 */ |
| 27897 | { |
| 27898 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 27899 | |
| 27900 | Float32 delayTime = 0.0; |
| 27901 | |
| 27902 | /* ... Read status and timestamp info (previous message) */ |
| 27903 | can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]); |
| 27904 | |
| 27905 | /* Convert timestamp */ |
| 27906 | if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->processed) { |
| 27907 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->timestamp = |
| 27908 | rtk_dsts_time_to_simtime_convert |
| 27909 | (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->timestamp); |
| 27910 | } |
| 27911 | |
| 27912 | /* Messages with timestamp zero have been received in pause/stop state |
| 27913 | and must not be handled. |
| 27914 | */ |
| 27915 | if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->timestamp > 0.0) { |
| 27916 | L4_MABX_B.SFunction1_o1_iu = (real_T) |
| 27917 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->processed; |
| 27918 | L4_MABX_B.SFunction1_o2_nv = (real_T) |
| 27919 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->timestamp; |
| 27920 | L4_MABX_B.SFunction1_o3_fu = (real_T) |
| 27921 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->deltatime; |
| 27922 | L4_MABX_B.SFunction1_o4_k = (real_T) |
| 27923 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->delaytime; |
| 27924 | } |
| 27925 | |
| 27926 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 27927 | { |
| 27928 | rtican_Signal_t CAN_Sgn; |
| 27929 | |
| 27930 | /* ...... "PneumaticSupplyPress" (0|8, standard signal, unsigned int, little endian) */ |
| 27931 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 27932 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.PneumaticSupplyPress - ( 0 ) |
| 27933 | ) / 8 + 0.5); |
| 27934 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 27935 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 27936 | |
| 27937 | /* ...... "ParkingAnd_orTrailerAirPress" (8|8, standard signal, unsigned int, little endian) */ |
| 27938 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 27939 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkingAnd_orTrailerAirPress |
| 27940 | - ( 0 ) ) / 8 + 0.5); |
| 27941 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 27942 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 27943 | |
| 27944 | /* ...... "ServiceBrakeCircuit1AirPress" (16|8, standard signal, unsigned int, little endian) */ |
| 27945 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 27946 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ServiceBrakeCircuit1AirPress |
| 27947 | - ( 0 ) ) / 8 + 0.5); |
| 27948 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 27949 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 27950 | |
| 27951 | /* ...... "ServiceBrakeCircuit2AirPress" (24|8, standard signal, unsigned int, little endian) */ |
| 27952 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 27953 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ServiceBrakeCircuit2AirPress |
| 27954 | - ( 0 ) ) / 8 + 0.5); |
| 27955 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 27956 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 27957 | |
| 27958 | /* ...... "AuxEquipmentSupplyPress" (32|8, standard signal, unsigned int, little endian) */ |
| 27959 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 27960 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AuxEquipmentSupplyPress - |
| 27961 | ( 0 ) ) / 8 + 0.5); |
| 27962 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 27963 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0; |
| 27964 | |
| 27965 | /* ...... "AirSuspensionSupplyPress" (40|8, standard signal, unsigned int, little endian) */ |
| 27966 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 27967 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AirSuspensionSupplyPress - ( |
| 27968 | 0 ) ) / 8 + 0.5); |
| 27969 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 27970 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 27971 | |
| 27972 | /* ...... "AirCompressorStatus" (48|2, standard signal, unsigned int, little endian) */ |
| 27973 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 27974 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AirCompressorStatus ) + 0.5); |
| 27975 | CAN_Sgn.UnsignedSgn &= 0x00000003; |
| 27976 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 27977 | |
| 27978 | /* ...... "PowertrainCircuitAirSupplyPress" (56|8, standard signal, unsigned int, little endian) */ |
| 27979 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 27980 | CAN_Sgn.UnsignedSgn = (UInt32) |
| 27981 | (( L4_MABX_B.PowertrainCircuitAirSupplyPress - ( 0 ) ) / 8 + 0.5); |
| 27982 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 27983 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0; |
| 27984 | } |
| 27985 | |
| 27986 | /* mask unused bits with '1' */ |
| 27987 | CAN_Msg[6] |= 0xFC; |
| 27988 | |
| 27989 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 27990 | can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31], 8, |
| 27991 | &(CAN_Msg[0]), delayTime); |
| 27992 | } |
| 27993 | } |
| 27994 | |
| 27995 | /* End of Outputs for SubSystem: '<S869>/AIR1' */ |
| 27996 | |
| 27997 | /* S-Function (sfix_bitop): '<S863>/Operator' */ |
| 27998 | L4_MABX_B.Operator_g2 = (uint8_T)(L4_MABX_B.DataTypeConversion_io & |
| 27999 | L4_MABX_P.Operator_BitMask_l); |
| 28000 | |
| 28001 | /* DataTypeConversion: '<S863>/DataType' */ |
| 28002 | L4_MABX_B.DataType_bc = L4_MABX_B.Operator_g2; |
| 28003 | |
| 28004 | /* S-Function (sfix_bitop): '<S864>/Operator' */ |
| 28005 | L4_MABX_B.Operator_ap = (uint8_T)(L4_MABX_B.DataTypeConversion_io & |
| 28006 | L4_MABX_P.Operator_BitMask_a); |
| 28007 | |
| 28008 | /* DataTypeConversion: '<S864>/DataType' */ |
| 28009 | L4_MABX_B.DataType_gvm = L4_MABX_B.Operator_ap; |
| 28010 | |
| 28011 | /* S-Function (sfix_bitop): '<S865>/Operator' */ |
| 28012 | L4_MABX_B.Operator_av = (uint8_T)(L4_MABX_B.DataTypeConversion_io & |
| 28013 | L4_MABX_P.Operator_BitMask_f); |
| 28014 | |
| 28015 | /* DataTypeConversion: '<S865>/DataType' */ |
| 28016 | L4_MABX_B.DataType_po = L4_MABX_B.Operator_av; |
| 28017 | |
| 28018 | /* S-Function (sfix_bitop): '<S867>/Operator' */ |
| 28019 | L4_MABX_B.Operator_ni = (uint8_T)(L4_MABX_B.DataTypeConversion_io & |
| 28020 | L4_MABX_P.Operator_BitMask_g); |
| 28021 | |
| 28022 | /* DataTypeConversion: '<S867>/DataType' */ |
| 28023 | L4_MABX_B.DataType_nu = L4_MABX_B.Operator_ni; |
| 28024 | |
| 28025 | /* S-Function (sfix_bitop): '<S868>/Operator' */ |
| 28026 | L4_MABX_B.Operator_cc = (uint8_T)(L4_MABX_B.DataTypeConversion_io & |
| 28027 | L4_MABX_P.Operator_BitMask_d); |
| 28028 | |
| 28029 | /* DataTypeConversion: '<S868>/DataType' */ |
| 28030 | L4_MABX_B.DataType_f = L4_MABX_B.Operator_cc; |
| 28031 | |
| 28032 | /* DataTypeConversion: '<S861>/Data Type Conversion2' */ |
| 28033 | L4_MABX_B.DataTypeConversion2_g2 = (L4_MABX_B.DataType_bc != 0); |
| 28034 | |
| 28035 | /* ArithShift: '<S861>/Shift_Arithmetic ' */ |
| 28036 | L4_MABX_B.Shift_Arithmetic_j = ldexp(L4_MABX_B.DataType_gvm, (-1)); |
| 28037 | |
| 28038 | /* DataTypeConversion: '<S861>/Data Type Conversion3' */ |
| 28039 | L4_MABX_B.DataTypeConversion3_da = (L4_MABX_B.Shift_Arithmetic_j != 0.0); |
| 28040 | |
| 28041 | /* ArithShift: '<S861>/Shift_Arithmetic 1' */ |
| 28042 | L4_MABX_B.Shift_Arithmetic1_j = ldexp(L4_MABX_B.DataType_po, (-2)); |
| 28043 | |
| 28044 | /* DataTypeConversion: '<S861>/Data Type Conversion4' */ |
| 28045 | L4_MABX_B.DataTypeConversion4_o = (L4_MABX_B.Shift_Arithmetic1_j != 0.0); |
| 28046 | |
| 28047 | /* ArithShift: '<S861>/Shift_Arithmetic 3' */ |
| 28048 | L4_MABX_B.Shift_Arithmetic3_p = ldexp(L4_MABX_B.DataType_nu, (-4)); |
| 28049 | |
| 28050 | /* DataTypeConversion: '<S861>/Data Type Conversion6' */ |
| 28051 | L4_MABX_B.DataTypeConversion6_hk = (L4_MABX_B.Shift_Arithmetic3_p != 0.0); |
| 28052 | |
| 28053 | /* ArithShift: '<S861>/Shift_Arithmetic 4' */ |
| 28054 | L4_MABX_B.Shift_Arithmetic4_p = ldexp(L4_MABX_B.DataType_f, (-5)); |
| 28055 | |
| 28056 | /* DataTypeConversion: '<S861>/Data Type Conversion7' */ |
| 28057 | L4_MABX_B.DataTypeConversion7_d0 = (L4_MABX_B.Shift_Arithmetic4_p != 0.0); |
| 28058 | |
| 28059 | /* DataTypeConversion: '<S862>/Data Type Conversion' incorporates: |
| 28060 | * Constant: '<S852>/Constant1' |
| 28061 | */ |
| 28062 | L4_MABX_B.DataTypeConversion_ao = (uint8_T)L4_MABX_P.Constant1_Value_e4; |
| 28063 | |
| 28064 | /* S-Function (sfix_bitop): '<S874>/Operator' */ |
| 28065 | L4_MABX_B.Operator_pq = (uint8_T)(L4_MABX_B.DataTypeConversion_ao & |
| 28066 | L4_MABX_P.Operator_BitMask_au); |
| 28067 | |
| 28068 | /* DataTypeConversion: '<S874>/DataType' */ |
| 28069 | L4_MABX_B.DataType_fy = L4_MABX_B.Operator_pq; |
| 28070 | |
| 28071 | /* ArithShift: '<S862>/Shift_Arithmetic 2' */ |
| 28072 | L4_MABX_B.Shift_Arithmetic2_l = ldexp(L4_MABX_B.DataType_fy, (-3)); |
| 28073 | |
| 28074 | /* DataTypeConversion: '<S862>/Data Type Conversion5' */ |
| 28075 | L4_MABX_B.DataTypeConversion5_l = (L4_MABX_B.Shift_Arithmetic2_l != 0.0); |
| 28076 | |
| 28077 | /* Outputs for Enabled SubSystem: '<S877>/AMB' incorporates: |
| 28078 | * EnablePort: '<S878>/Enable' |
| 28079 | */ |
| 28080 | if (L4_MABX_B.DataTypeConversion5_l) { |
| 28081 | /* S-Function (rti_commonblock): '<S878>/S-Function1' */ |
| 28082 | /* This comment workarounds a code generation problem */ |
| 28083 | |
| 28084 | /* dSPACE RTICAN TX Message Block: "AMB" Id:419362048 */ |
| 28085 | { |
| 28086 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 28087 | |
| 28088 | Float32 delayTime = 0.0; |
| 28089 | |
| 28090 | /* ... Read status and timestamp info (previous message) */ |
| 28091 | can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]); |
| 28092 | |
| 28093 | /* Convert timestamp */ |
| 28094 | if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->processed) { |
| 28095 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->timestamp = |
| 28096 | rtk_dsts_time_to_simtime_convert |
| 28097 | (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->timestamp); |
| 28098 | } |
| 28099 | |
| 28100 | /* Messages with timestamp zero have been received in pause/stop state |
| 28101 | and must not be handled. |
| 28102 | */ |
| 28103 | if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->timestamp > 0.0) { |
| 28104 | L4_MABX_B.SFunction1_o1_jf = (real_T) |
| 28105 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->processed; |
| 28106 | L4_MABX_B.SFunction1_o2_g5 = (real_T) |
| 28107 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->timestamp; |
| 28108 | L4_MABX_B.SFunction1_o3_gz = (real_T) |
| 28109 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->deltatime; |
| 28110 | L4_MABX_B.SFunction1_o4_cf = (real_T) |
| 28111 | can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->delaytime; |
| 28112 | } |
| 28113 | |
| 28114 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 28115 | { |
| 28116 | rtican_Signal_t CAN_Sgn; |
| 28117 | |
| 28118 | /* ...... "BarometricPress" (0|8, standard signal, unsigned int, little endian) */ |
| 28119 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28120 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.BarometricPress_n - ( 0 ) ) / |
| 28121 | 0.5 + 0.5); |
| 28122 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28123 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 28124 | |
| 28125 | /* ...... "CabInteriorTemp" (8|16, standard signal, unsigned int, little endian) */ |
| 28126 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28127 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CabInteriorTemp - ( -273 ) ) |
| 28128 | / 0.03125 + 0.5); |
| 28129 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 28130 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 28131 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte1; |
| 28132 | |
| 28133 | /* ...... "AmbientAirTemp" (24|16, standard signal, unsigned int, little endian) */ |
| 28134 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28135 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AmbientAirTemp_a - ( -273 ) ) |
| 28136 | / 0.03125 + 0.5); |
| 28137 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 28138 | CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0; |
| 28139 | CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte1; |
| 28140 | |
| 28141 | /* ...... "EngAirIntakeTemp" (40|8, standard signal, unsigned int, little endian) */ |
| 28142 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28143 | CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.EngAirIntakeTemp - ( -40 ) + |
| 28144 | 0.5); |
| 28145 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28146 | CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0; |
| 28147 | |
| 28148 | /* ...... "RoadSurfaceTemp" (48|16, standard signal, unsigned int, little endian) */ |
| 28149 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28150 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.RoadSurfaceTemp - ( -273 ) ) |
| 28151 | / 0.03125 + 0.5); |
| 28152 | CAN_Sgn.UnsignedSgn &= 0x0000FFFF; |
| 28153 | CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0; |
| 28154 | CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte1; |
| 28155 | } |
| 28156 | |
| 28157 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 28158 | can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500], 8, |
| 28159 | &(CAN_Msg[0]), delayTime); |
| 28160 | } |
| 28161 | } |
| 28162 | |
| 28163 | /* End of Outputs for SubSystem: '<S877>/AMB' */ |
| 28164 | |
| 28165 | /* S-Function (sfix_bitop): '<S871>/Operator' */ |
| 28166 | L4_MABX_B.Operator_nc = (uint8_T)(L4_MABX_B.DataTypeConversion_ao & |
| 28167 | L4_MABX_P.Operator_BitMask_i); |
| 28168 | |
| 28169 | /* DataTypeConversion: '<S871>/DataType' */ |
| 28170 | L4_MABX_B.DataType_lw = L4_MABX_B.Operator_nc; |
| 28171 | |
| 28172 | /* S-Function (sfix_bitop): '<S872>/Operator' */ |
| 28173 | L4_MABX_B.Operator_kv = (uint8_T)(L4_MABX_B.DataTypeConversion_ao & |
| 28174 | L4_MABX_P.Operator_BitMask_j); |
| 28175 | |
| 28176 | /* DataTypeConversion: '<S872>/DataType' */ |
| 28177 | L4_MABX_B.DataType_nh = L4_MABX_B.Operator_kv; |
| 28178 | |
| 28179 | /* S-Function (sfix_bitop): '<S873>/Operator' */ |
| 28180 | L4_MABX_B.Operator_kel = (uint8_T)(L4_MABX_B.DataTypeConversion_ao & |
| 28181 | L4_MABX_P.Operator_BitMask_m); |
| 28182 | |
| 28183 | /* DataTypeConversion: '<S873>/DataType' */ |
| 28184 | L4_MABX_B.DataType_nl = L4_MABX_B.Operator_kel; |
| 28185 | |
| 28186 | /* S-Function (sfix_bitop): '<S875>/Operator' */ |
| 28187 | L4_MABX_B.Operator_n0 = (uint8_T)(L4_MABX_B.DataTypeConversion_ao & |
| 28188 | L4_MABX_P.Operator_BitMask_c); |
| 28189 | |
| 28190 | /* DataTypeConversion: '<S875>/DataType' */ |
| 28191 | L4_MABX_B.DataType_jr = L4_MABX_B.Operator_n0; |
| 28192 | |
| 28193 | /* S-Function (sfix_bitop): '<S876>/Operator' */ |
| 28194 | L4_MABX_B.Operator_dj = (uint8_T)(L4_MABX_B.DataTypeConversion_ao & |
| 28195 | L4_MABX_P.Operator_BitMask_m4); |
| 28196 | |
| 28197 | /* DataTypeConversion: '<S876>/DataType' */ |
| 28198 | L4_MABX_B.DataType_n2 = L4_MABX_B.Operator_dj; |
| 28199 | |
| 28200 | /* DataTypeConversion: '<S862>/Data Type Conversion2' */ |
| 28201 | L4_MABX_B.DataTypeConversion2_iw = (L4_MABX_B.DataType_lw != 0); |
| 28202 | |
| 28203 | /* ArithShift: '<S862>/Shift_Arithmetic ' */ |
| 28204 | L4_MABX_B.Shift_Arithmetic_e = ldexp(L4_MABX_B.DataType_nh, (-1)); |
| 28205 | |
| 28206 | /* DataTypeConversion: '<S862>/Data Type Conversion3' */ |
| 28207 | L4_MABX_B.DataTypeConversion3_bt = (L4_MABX_B.Shift_Arithmetic_e != 0.0); |
| 28208 | |
| 28209 | /* ArithShift: '<S862>/Shift_Arithmetic 1' */ |
| 28210 | L4_MABX_B.Shift_Arithmetic1_a = ldexp(L4_MABX_B.DataType_nl, (-2)); |
| 28211 | |
| 28212 | /* DataTypeConversion: '<S862>/Data Type Conversion4' */ |
| 28213 | L4_MABX_B.DataTypeConversion4_io = (L4_MABX_B.Shift_Arithmetic1_a != 0.0); |
| 28214 | |
| 28215 | /* ArithShift: '<S862>/Shift_Arithmetic 3' */ |
| 28216 | L4_MABX_B.Shift_Arithmetic3_fz = ldexp(L4_MABX_B.DataType_jr, (-4)); |
| 28217 | |
| 28218 | /* DataTypeConversion: '<S862>/Data Type Conversion6' */ |
| 28219 | L4_MABX_B.DataTypeConversion6_dn = (L4_MABX_B.Shift_Arithmetic3_fz != 0.0); |
| 28220 | |
| 28221 | /* ArithShift: '<S862>/Shift_Arithmetic 4' */ |
| 28222 | L4_MABX_B.Shift_Arithmetic4_d = ldexp(L4_MABX_B.DataType_n2, (-5)); |
| 28223 | |
| 28224 | /* DataTypeConversion: '<S862>/Data Type Conversion7' */ |
| 28225 | L4_MABX_B.DataTypeConversion7_i = (L4_MABX_B.Shift_Arithmetic4_d != 0.0); |
| 28226 | |
| 28227 | /* End of Outputs for SubSystem: '<S849>/CAN_TX_1000ms' */ |
| 28228 | /* user code (Output function Trailer for TID6) */ |
| 28229 | |
| 28230 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 28231 | /* EventChannel: 0 */ |
| 28232 | if (tid == 0) { |
| 28233 | DSXCP_service(0); |
| 28234 | } |
| 28235 | |
| 28236 | /* If subsystem generates rate grouping Output functions, |
| 28237 | * when tid is used in Output function for one rate, |
| 28238 | * all Output functions include tid as a local variable. |
| 28239 | * As result, some Output functions may have unused tid. |
| 28240 | */ |
| 28241 | UNUSED_PARAMETER(tid); |
| 28242 | } |
| 28243 | |
| 28244 | /* Model update function for TID6 */ |
| 28245 | void L4_MABX_update6(void) /* Sample time: [1.0s, 0.0s] */ |
| 28246 | { |
| 28247 | /* (no update code required) */ |
| 28248 | } |
| 28249 | |
| 28250 | /* Model output function for TID7 */ |
| 28251 | void L4_MABX_output7(void) /* Sample time: [5.0s, 0.0s] */ |
| 28252 | { |
| 28253 | int_T tid = 7; |
| 28254 | int32_T i; |
| 28255 | uint16_T tmp; |
| 28256 | uint32_T q0; |
| 28257 | uint32_T qY; |
| 28258 | |
| 28259 | /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_5000ms' */ |
| 28260 | |
| 28261 | /* DataTypeConversion: '<S1040>/Data Type Conversion6' incorporates: |
| 28262 | * Constant: '<S1040>/Enable_TX_RequestDiagMsgFromREAX' |
| 28263 | */ |
| 28264 | L4_MABX_B.DataTypeConversion6_j1 = L4_MABX_P.Enable_TX_RequestDiagMsgFromREA; |
| 28265 | |
| 28266 | /* Logic: '<S1044>/Operator' */ |
| 28267 | L4_MABX_B.Operator_la = (L4_MABX_B.DataTypeConversion6_j1 && |
| 28268 | L4_MABX_B.TmpRTBAtOperatorInport2); |
| 28269 | |
| 28270 | /* DataTypeConversion: '<S1044>/DataType' */ |
| 28271 | L4_MABX_B.DataType_kum = L4_MABX_B.Operator_la; |
| 28272 | |
| 28273 | /* Reshape: '<S1049>/Reshape' incorporates: |
| 28274 | * Constant: '<S1049>/Constant' |
| 28275 | */ |
| 28276 | for (i = 0; i < 8; i++) { |
| 28277 | L4_MABX_B.Reshape[i] = L4_MABX_P.Repeating_Sequence_Stair_OutVal[i]; |
| 28278 | } |
| 28279 | |
| 28280 | /* End of Reshape: '<S1049>/Reshape' */ |
| 28281 | |
| 28282 | /* UnitDelay: '<S1049>/Unit_Delay' */ |
| 28283 | L4_MABX_B.Unit_Delay_av = L4_MABX_DW.Unit_Delay_DSTATE_og; |
| 28284 | |
| 28285 | /* UnitDelay: '<S1050>/Unit Delay' */ |
| 28286 | L4_MABX_B.UnitDelay_g = L4_MABX_DW.UnitDelay_DSTATE_b; |
| 28287 | |
| 28288 | /* Switch: '<S1053>/Switch1' incorporates: |
| 28289 | * Constant: '<S1050>/E' |
| 28290 | * Constant: '<S1050>/IV' |
| 28291 | * Switch: '<S1052>/Switch1' |
| 28292 | */ |
| 28293 | if (L4_MABX_B.Unit_Delay_av) { |
| 28294 | L4_MABX_B.Switch1_l = L4_MABX_P.IV_Value_mk; |
| 28295 | } else { |
| 28296 | if (L4_MABX_P.E_Value_n) { |
| 28297 | /* Sum: '<S1050>/Subtract' incorporates: |
| 28298 | * Constant: '<S1050>/Constant' |
| 28299 | * Switch: '<S1052>/Switch1' |
| 28300 | */ |
| 28301 | q0 = L4_MABX_P.Constant_Value_h5; |
| 28302 | qY = q0 + L4_MABX_B.UnitDelay_g; |
| 28303 | if (qY < q0) { |
| 28304 | qY = MAX_uint32_T; |
| 28305 | } |
| 28306 | |
| 28307 | L4_MABX_B.Subtract_h = qY; |
| 28308 | |
| 28309 | /* End of Sum: '<S1050>/Subtract' */ |
| 28310 | |
| 28311 | /* Switch: '<S1052>/Switch1' */ |
| 28312 | L4_MABX_B.Switch1_o = L4_MABX_B.Subtract_h; |
| 28313 | } else { |
| 28314 | /* Switch: '<S1052>/Switch1' */ |
| 28315 | L4_MABX_B.Switch1_o = L4_MABX_B.UnitDelay_g; |
| 28316 | } |
| 28317 | |
| 28318 | L4_MABX_B.Switch1_l = L4_MABX_B.Switch1_o; |
| 28319 | } |
| 28320 | |
| 28321 | /* End of Switch: '<S1053>/Switch1' */ |
| 28322 | |
| 28323 | /* Selector: '<S1049>/Selector' */ |
| 28324 | L4_MABX_B.Selector = L4_MABX_B.Reshape[(int32_T)L4_MABX_B.Switch1_l - 1]; |
| 28325 | |
| 28326 | /* DataTypeConversion: '<S1041>/Data Type Conversion' */ |
| 28327 | L4_MABX_B.DataTypeConversion_m = L4_MABX_B.Selector; |
| 28328 | |
| 28329 | /* S-Function (sfix_bitop): '<S1046>/Operator' */ |
| 28330 | L4_MABX_B.Operator = L4_MABX_B.DataTypeConversion_m & |
| 28331 | L4_MABX_P.Operator_BitMask_al; |
| 28332 | |
| 28333 | /* DataTypeConversion: '<S1046>/DataType' */ |
| 28334 | q0 = L4_MABX_B.Operator; |
| 28335 | if (q0 > 255U) { |
| 28336 | q0 = 255U; |
| 28337 | } |
| 28338 | |
| 28339 | L4_MABX_B.DataType_jy = (uint8_T)q0; |
| 28340 | |
| 28341 | /* End of DataTypeConversion: '<S1046>/DataType' */ |
| 28342 | |
| 28343 | /* DataTypeConversion: '<S1041>/Data Type Conversion3' */ |
| 28344 | L4_MABX_B.DataTypeConversion3_hc = L4_MABX_B.DataType_jy; |
| 28345 | |
| 28346 | /* DataTypeConversion: '<S1043>/Data Type Conversion' */ |
| 28347 | L4_MABX_B.DataTypeConversion_np = L4_MABX_B.DataTypeConversion3_hc; |
| 28348 | |
| 28349 | /* S-Function (sfix_bitop): '<S1047>/Operator' */ |
| 28350 | L4_MABX_B.Operator_p = L4_MABX_B.DataTypeConversion_m & |
| 28351 | L4_MABX_P.Operator_BitMask_o4; |
| 28352 | |
| 28353 | /* DataTypeConversion: '<S1047>/DataType' */ |
| 28354 | q0 = L4_MABX_B.Operator_p; |
| 28355 | if (q0 > 65535U) { |
| 28356 | q0 = 65535U; |
| 28357 | } |
| 28358 | |
| 28359 | L4_MABX_B.DataType_mx = (uint16_T)q0; |
| 28360 | |
| 28361 | /* End of DataTypeConversion: '<S1047>/DataType' */ |
| 28362 | |
| 28363 | /* ArithShift: '<S1041>/Shift_Arithmetic ' */ |
| 28364 | L4_MABX_B.Shift_Arithmetic_ca = (uint16_T)((uint32_T)L4_MABX_B.DataType_mx >> |
| 28365 | 8); |
| 28366 | |
| 28367 | /* DataTypeConversion: '<S1041>/Data Type Conversion1' */ |
| 28368 | tmp = L4_MABX_B.Shift_Arithmetic_ca; |
| 28369 | if (tmp > 255) { |
| 28370 | tmp = 255U; |
| 28371 | } |
| 28372 | |
| 28373 | L4_MABX_B.DataTypeConversion1_ok = (uint8_T)tmp; |
| 28374 | |
| 28375 | /* End of DataTypeConversion: '<S1041>/Data Type Conversion1' */ |
| 28376 | |
| 28377 | /* DataTypeConversion: '<S1043>/Data Type Conversion1' */ |
| 28378 | L4_MABX_B.DataTypeConversion1_p = L4_MABX_B.DataTypeConversion1_ok; |
| 28379 | |
| 28380 | /* S-Function (sfix_bitop): '<S1048>/Operator' */ |
| 28381 | L4_MABX_B.Operator_ps = L4_MABX_B.DataTypeConversion_m & |
| 28382 | L4_MABX_P.Operator_BitMask_g5; |
| 28383 | |
| 28384 | /* DataTypeConversion: '<S1048>/DataType' */ |
| 28385 | L4_MABX_B.DataType_on = L4_MABX_B.Operator_ps; |
| 28386 | |
| 28387 | /* ArithShift: '<S1041>/Shift_Arithmetic 1' */ |
| 28388 | L4_MABX_B.Shift_Arithmetic1_lv = L4_MABX_B.DataType_on >> 16; |
| 28389 | |
| 28390 | /* DataTypeConversion: '<S1041>/Data Type Conversion2' */ |
| 28391 | q0 = L4_MABX_B.Shift_Arithmetic1_lv; |
| 28392 | if (q0 > 255U) { |
| 28393 | q0 = 255U; |
| 28394 | } |
| 28395 | |
| 28396 | L4_MABX_B.DataTypeConversion2_em = (uint8_T)q0; |
| 28397 | |
| 28398 | /* End of DataTypeConversion: '<S1041>/Data Type Conversion2' */ |
| 28399 | |
| 28400 | /* DataTypeConversion: '<S1043>/Data Type Conversion2' */ |
| 28401 | L4_MABX_B.DataTypeConversion2_kn = L4_MABX_B.DataTypeConversion2_em; |
| 28402 | |
| 28403 | /* Outputs for Enabled SubSystem: '<S1043>/RQST_13_E4' incorporates: |
| 28404 | * EnablePort: '<S1045>/Enable' |
| 28405 | */ |
| 28406 | if (L4_MABX_B.DataType_kum) { |
| 28407 | /* S-Function (rti_commonblock): '<S1045>/S-Function1' */ |
| 28408 | /* This comment workarounds a code generation problem */ |
| 28409 | |
| 28410 | /* dSPACE RTICAN TX Message Block: "RQST_13_E4" Id:417993700 */ |
| 28411 | { |
| 28412 | UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 28413 | |
| 28414 | Float32 delayTime = 0.0; |
| 28415 | |
| 28416 | /* ... Read status and timestamp info (previous message) */ |
| 28417 | can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]); |
| 28418 | |
| 28419 | /* Convert timestamp */ |
| 28420 | if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->processed) { |
| 28421 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->timestamp = |
| 28422 | rtk_dsts_time_to_simtime_convert |
| 28423 | (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->timestamp); |
| 28424 | } |
| 28425 | |
| 28426 | /* Messages with timestamp zero have been received in pause/stop state |
| 28427 | and must not be handled. |
| 28428 | */ |
| 28429 | if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->timestamp > 0.0) { |
| 28430 | L4_MABX_B.SFunction1_o1_b = (real_T) |
| 28431 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->processed; |
| 28432 | L4_MABX_B.SFunction1_o2_d = (real_T) |
| 28433 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->timestamp; |
| 28434 | L4_MABX_B.SFunction1_o3_gb = (real_T) |
| 28435 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->deltatime; |
| 28436 | L4_MABX_B.SFunction1_o4_j = (real_T) |
| 28437 | can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->delaytime; |
| 28438 | } |
| 28439 | |
| 28440 | /* ... Encode Simulink signals of TX and RM blocks*/ |
| 28441 | { |
| 28442 | rtican_Signal_t CAN_Sgn; |
| 28443 | |
| 28444 | /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */ |
| 28445 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28446 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_np ) + |
| 28447 | 0.5); |
| 28448 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28449 | CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0; |
| 28450 | |
| 28451 | /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */ |
| 28452 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28453 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p ) + |
| 28454 | 0.5); |
| 28455 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28456 | CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0; |
| 28457 | |
| 28458 | /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */ |
| 28459 | /* Add or substract 0.5 in order to round to nearest integer */ |
| 28460 | CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion2_kn ) + |
| 28461 | 0.5); |
| 28462 | CAN_Sgn.UnsignedSgn &= 0x000000FF; |
| 28463 | CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0; |
| 28464 | } |
| 28465 | |
| 28466 | /* ... Write the data to the CAN microcontroller and trigger the sending of the message */ |
| 28467 | can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4], 8, |
| 28468 | &(CAN_Msg[0]), delayTime); |
| 28469 | } |
| 28470 | } |
| 28471 | |
| 28472 | /* End of Outputs for SubSystem: '<S1043>/RQST_13_E4' */ |
| 28473 | |
| 28474 | /* RelationalOperator: '<S1051>/Operator' */ |
| 28475 | L4_MABX_B.Operator_hgg = (L4_MABX_B.Switch1_l == L4_MABX_B.Width); |
| 28476 | |
| 28477 | /* End of Outputs for SubSystem: '<S849>/CAN_TX_5000ms' */ |
| 28478 | /* user code (Output function Trailer for TID7) */ |
| 28479 | |
| 28480 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 28481 | /* EventChannel: 0 */ |
| 28482 | if (tid == 0) { |
| 28483 | DSXCP_service(0); |
| 28484 | } |
| 28485 | |
| 28486 | /* If subsystem generates rate grouping Output functions, |
| 28487 | * when tid is used in Output function for one rate, |
| 28488 | * all Output functions include tid as a local variable. |
| 28489 | * As result, some Output functions may have unused tid. |
| 28490 | */ |
| 28491 | UNUSED_PARAMETER(tid); |
| 28492 | } |
| 28493 | |
| 28494 | /* Model update function for TID7 */ |
| 28495 | void L4_MABX_update7(void) /* Sample time: [5.0s, 0.0s] */ |
| 28496 | { |
| 28497 | /* Update for Atomic SubSystem: '<S849>/CAN_TX_5000ms' */ |
| 28498 | |
| 28499 | /* Update for UnitDelay: '<S1049>/Unit_Delay' */ |
| 28500 | L4_MABX_DW.Unit_Delay_DSTATE_og = L4_MABX_B.Operator_hgg; |
| 28501 | |
| 28502 | /* Update for UnitDelay: '<S1050>/Unit Delay' */ |
| 28503 | L4_MABX_DW.UnitDelay_DSTATE_b = L4_MABX_B.Switch1_l; |
| 28504 | |
| 28505 | /* End of Update for SubSystem: '<S849>/CAN_TX_5000ms' */ |
| 28506 | } |
| 28507 | |
| 28508 | /* Model output function for TID8 */ |
| 28509 | void L4_MABX_output8(void) /* Sample time: [10.0s, 0.0s] */ |
| 28510 | { |
| 28511 | int_T tid = 8; |
| 28512 | |
| 28513 | /* user code (Output function Trailer for TID8) */ |
| 28514 | |
| 28515 | /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */ |
| 28516 | /* EventChannel: 0 */ |
| 28517 | if (tid == 0) { |
| 28518 | DSXCP_service(0); |
| 28519 | } |
| 28520 | |
| 28521 | /* If subsystem generates rate grouping Output functions, |
| 28522 | * when tid is used in Output function for one rate, |
| 28523 | * all Output functions include tid as a local variable. |
| 28524 | * As result, some Output functions may have unused tid. |
| 28525 | */ |
| 28526 | UNUSED_PARAMETER(tid); |
| 28527 | } |
| 28528 | |
| 28529 | /* Model update function for TID8 */ |
| 28530 | void L4_MABX_update8(void) /* Sample time: [10.0s, 0.0s] */ |
| 28531 | { |
| 28532 | /* (no update code required) */ |
| 28533 | } |
| 28534 | |
| 28535 | /* Model output wrapper function for compatibility with a static main program */ |
| 28536 | void L4_MABX_output(int_T tid) |
| 28537 | { |
| 28538 | switch (tid) { |
| 28539 | case 0 : |
| 28540 | L4_MABX_output0(); |
| 28541 | break; |
| 28542 | |
| 28543 | case 1 : |
| 28544 | L4_MABX_output1(); |
| 28545 | break; |
| 28546 | |
| 28547 | case 2 : |
| 28548 | L4_MABX_output2(); |
| 28549 | break; |
| 28550 | |
| 28551 | case 3 : |
| 28552 | L4_MABX_output3(); |
| 28553 | break; |
| 28554 | |
| 28555 | case 4 : |
| 28556 | L4_MABX_output4(); |
| 28557 | break; |
| 28558 | |
| 28559 | case 5 : |
| 28560 | L4_MABX_output5(); |
| 28561 | break; |
| 28562 | |
| 28563 | case 6 : |
| 28564 | L4_MABX_output6(); |
| 28565 | break; |
| 28566 | |
| 28567 | case 7 : |
| 28568 | L4_MABX_output7(); |
| 28569 | break; |
| 28570 | |
| 28571 | case 8 : |
| 28572 | L4_MABX_output8(); |
| 28573 | break; |
| 28574 | |
| 28575 | default : |
| 28576 | break; |
| 28577 | } |
| 28578 | } |
| 28579 | |
| 28580 | /* Model update wrapper function for compatibility with a static main program */ |
| 28581 | void L4_MABX_update(int_T tid) |
| 28582 | { |
| 28583 | switch (tid) { |
| 28584 | case 0 : |
| 28585 | L4_MABX_update0(); |
| 28586 | break; |
| 28587 | |
| 28588 | case 1 : |
| 28589 | L4_MABX_update1(); |
| 28590 | break; |
| 28591 | |
| 28592 | case 2 : |
| 28593 | L4_MABX_update2(); |
| 28594 | break; |
| 28595 | |
| 28596 | case 3 : |
| 28597 | L4_MABX_update3(); |
| 28598 | break; |
| 28599 | |
| 28600 | case 4 : |
| 28601 | L4_MABX_update4(); |
| 28602 | break; |
| 28603 | |
| 28604 | case 5 : |
| 28605 | L4_MABX_update5(); |
| 28606 | break; |
| 28607 | |
| 28608 | case 6 : |
| 28609 | L4_MABX_update6(); |
| 28610 | break; |
| 28611 | |
| 28612 | case 7 : |
| 28613 | L4_MABX_update7(); |
| 28614 | break; |
| 28615 | |
| 28616 | case 8 : |
| 28617 | L4_MABX_update8(); |
| 28618 | break; |
| 28619 | |
| 28620 | default : |
| 28621 | break; |
| 28622 | } |
| 28623 | } |
| 28624 | |
| 28625 | /* Model initialize function */ |
| 28626 | void L4_MABX_initialize(void) |
| 28627 | { |
| 28628 | /* Registration code */ |
| 28629 | |
| 28630 | /* initialize non-finites */ |
| 28631 | rt_InitInfAndNaN(sizeof(real_T)); |
| 28632 | |
| 28633 | /* non-finite (run-time) assignments */ |
| 28634 | L4_MABX_P.Saturation_UpperSat = rtInf; |
| 28635 | L4_MABX_P.Saturation_UpperSat_o = rtInf; |
| 28636 | L4_MABX_P.Saturation_UpperSat_f = rtInf; |
| 28637 | L4_MABX_P.Saturation1_UpperSat_j = rtInf; |
| 28638 | L4_MABX_P.Saturation_UpperSat_l = rtInf; |
| 28639 | L4_MABX_P.Saturation_UpperSat_o1 = rtInf; |
| 28640 | L4_MABX_P.Saturation_UpperSat_d = rtInf; |
| 28641 | L4_MABX_P.Saturation_UpperSat_ok = rtInf; |
| 28642 | L4_MABX_P.Saturation_UpperSat_k = rtInf; |
| 28643 | L4_MABX_P.Saturation_UpperSat_gp = rtInf; |
| 28644 | L4_MABX_P.Calculate_D_term_h.Saturation_UpperSat = rtInf; |
| 28645 | L4_MABX_P.Calculate_D_term_p.Saturation_UpperSat = rtInf; |
| 28646 | L4_MABX_P.Calculate_D_term.Saturation_UpperSat = rtInf; |
| 28647 | |
| 28648 | /* initialize real-time model */ |
| 28649 | (void) memset((void *)L4_MABX_M, 0, |
| 28650 | sizeof(RT_MODEL_L4_MABX_T)); |
| 28651 | (L4_MABX_M)->Timing.TaskCounters.cLimit[0] = 1; |
| 28652 | (L4_MABX_M)->Timing.TaskCounters.cLimit[1] = 2; |
| 28653 | (L4_MABX_M)->Timing.TaskCounters.cLimit[2] = 5; |
| 28654 | (L4_MABX_M)->Timing.TaskCounters.cLimit[3] = 10; |
| 28655 | (L4_MABX_M)->Timing.TaskCounters.cLimit[4] = 25; |
| 28656 | (L4_MABX_M)->Timing.TaskCounters.cLimit[5] = 50; |
| 28657 | (L4_MABX_M)->Timing.TaskCounters.cLimit[6] = 100; |
| 28658 | (L4_MABX_M)->Timing.TaskCounters.cLimit[7] = 500; |
| 28659 | (L4_MABX_M)->Timing.TaskCounters.cLimit[8] = 1000; |
| 28660 | rtsiSetSolverName(&L4_MABX_M->solverInfo,"FixedStepDiscrete"); |
| 28661 | L4_MABX_M->solverInfoPtr = (&L4_MABX_M->solverInfo); |
| 28662 | |
| 28663 | /* Initialize timing info */ |
| 28664 | { |
| 28665 | int_T *mdlTsMap = L4_MABX_M->Timing.sampleTimeTaskIDArray; |
| 28666 | int_T i; |
| 28667 | for (i = 0; i < 9; i++) { |
| 28668 | mdlTsMap[i] = i; |
| 28669 | } |
| 28670 | |
| 28671 | L4_MABX_M->Timing.sampleTimeTaskIDPtr = (&mdlTsMap[0]); |
| 28672 | L4_MABX_M->Timing.sampleTimes = (&L4_MABX_M->Timing.sampleTimesArray[0]); |
| 28673 | L4_MABX_M->Timing.offsetTimes = (&L4_MABX_M->Timing.offsetTimesArray[0]); |
| 28674 | |
| 28675 | /* task periods */ |
| 28676 | L4_MABX_M->Timing.sampleTimes[0] = (0.01); |
| 28677 | L4_MABX_M->Timing.sampleTimes[1] = (0.02); |
| 28678 | L4_MABX_M->Timing.sampleTimes[2] = (0.05); |
| 28679 | L4_MABX_M->Timing.sampleTimes[3] = (0.1); |
| 28680 | L4_MABX_M->Timing.sampleTimes[4] = (0.25); |
| 28681 | L4_MABX_M->Timing.sampleTimes[5] = (0.5); |
| 28682 | L4_MABX_M->Timing.sampleTimes[6] = (1.0); |
| 28683 | L4_MABX_M->Timing.sampleTimes[7] = (5.0); |
| 28684 | L4_MABX_M->Timing.sampleTimes[8] = (10.0); |
| 28685 | |
| 28686 | /* task offsets */ |
| 28687 | L4_MABX_M->Timing.offsetTimes[0] = (0.0); |
| 28688 | L4_MABX_M->Timing.offsetTimes[1] = (0.0); |
| 28689 | L4_MABX_M->Timing.offsetTimes[2] = (0.0); |
| 28690 | L4_MABX_M->Timing.offsetTimes[3] = (0.0); |
| 28691 | L4_MABX_M->Timing.offsetTimes[4] = (0.0); |
| 28692 | L4_MABX_M->Timing.offsetTimes[5] = (0.0); |
| 28693 | L4_MABX_M->Timing.offsetTimes[6] = (0.0); |
| 28694 | L4_MABX_M->Timing.offsetTimes[7] = (0.0); |
| 28695 | L4_MABX_M->Timing.offsetTimes[8] = (0.0); |
| 28696 | } |
| 28697 | |
| 28698 | rtmSetTPtr(L4_MABX_M, &L4_MABX_M->Timing.tArray[0]); |
| 28699 | |
| 28700 | { |
| 28701 | int_T *mdlSampleHits = L4_MABX_M->Timing.sampleHitArray; |
| 28702 | int_T *mdlPerTaskSampleHits = L4_MABX_M->Timing.perTaskSampleHitsArray; |
| 28703 | L4_MABX_M->Timing.perTaskSampleHits = (&mdlPerTaskSampleHits[0]); |
| 28704 | mdlSampleHits[0] = 1; |
| 28705 | L4_MABX_M->Timing.sampleHits = (&mdlSampleHits[0]); |
| 28706 | } |
| 28707 | |
| 28708 | rtmSetTFinal(L4_MABX_M, -1); |
| 28709 | L4_MABX_M->Timing.stepSize0 = 0.01; |
| 28710 | L4_MABX_M->Timing.stepSize9 = 2.3283064365386963E-10; |
| 28711 | L4_MABX_M->Timing.stepSize10 = 2.3283064365386963E-10; |
| 28712 | L4_MABX_M->Timing.stepSize11 = 2.3283064365386963E-10; |
| 28713 | L4_MABX_M->solverInfoPtr = (&L4_MABX_M->solverInfo); |
| 28714 | L4_MABX_M->Timing.stepSize = (0.01); |
| 28715 | rtsiSetFixedStepSize(&L4_MABX_M->solverInfo, 0.01); |
| 28716 | rtsiSetSolverMode(&L4_MABX_M->solverInfo, SOLVER_MODE_MULTITASKING); |
| 28717 | |
| 28718 | /* block I/O */ |
| 28719 | (void) memset(((void *) &L4_MABX_B), 0, |
| 28720 | sizeof(B_L4_MABX_T)); |
| 28721 | |
| 28722 | { |
| 28723 | L4_MABX_B.EPBPCMInhibitStatusFeedback = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE; |
| 28724 | L4_MABX_B.EPBPCMInhibitStatusFeedback_k = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE; |
| 28725 | L4_MABX_B.EPBPCMManualStatusFeedback = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE; |
| 28726 | L4_MABX_B.EPBPCMManualStatusFeedback_p = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE; |
| 28727 | L4_MABX_B.EPBPCMInhibitStatusFeedback_d = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE; |
| 28728 | L4_MABX_B.EPBPCMInhibitStatusFeedback_m = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE; |
| 28729 | L4_MABX_B.EPBPCMManualStatusFeedback_f = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE; |
| 28730 | L4_MABX_B.EPBPCMManualStatusFeedback_m = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE; |
| 28731 | L4_MABX_B.XPRErrorState = ENUM_XPR_ERROR_STATE_T_XPR_OK; |
| 28732 | L4_MABX_B.XPRErrorState_d = ENUM_XPR_ERROR_STATE_T_XPR_OK; |
| 28733 | L4_MABX_B.XPRControlMode = ENUM_XPR_CONTROL_MODE_T_NO_BRAKE_DEMAND; |
| 28734 | L4_MABX_B.XPRControlMode_d = ENUM_XPR_CONTROL_MODE_T_NO_BRAKE_DEMAND; |
| 28735 | L4_MABX_B.XBRPassThroughActive = ENUM_XBR_PASS_THROUGH_ACTIVE_T_NOT_ACTIVE; |
| 28736 | L4_MABX_B.DataTypeConversion_lr = ENUM_SWITCH_T_OFF; |
| 28737 | L4_MABX_B.DataTypeConversion1_lu = ENUM_SWITCH_T_OFF; |
| 28738 | L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE; |
| 28739 | L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE; |
| 28740 | L4_MABX_B.BrkPedArbBrakeSwitch = ENUM_J1939_SWITCH_T_OFF; |
| 28741 | L4_MABX_B.BrkPedArbBrakeSwitch_c = ENUM_J1939_SWITCH_T_OFF; |
| 28742 | L4_MABX_B.DataTypeConversion1_c = ENUM_J1939_SWITCH_T_OFF; |
| 28743 | L4_MABX_B.DataTypeConversion3_l5 = ENUM_J1939_SWITCH_T_OFF; |
| 28744 | L4_MABX_B.VehCtrlState = ENUM_AUTO_CTRL_VEHICLE_STATE_T_NOT_AVAILABLE; |
| 28745 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_NOT_AVAILABLE; |
| 28746 | L4_MABX_B.If_Then_Else_ob.XBRPriority = ENUM_XBR_PRIORITY_T_HIGHEST_PRIORITY; |
| 28747 | L4_MABX_B.If_Then_Else_ob.XBRPassThroughActive = |
| 28748 | ENUM_XBR_PASS_THROUGH_ACTIVE_T_NOT_ACTIVE; |
| 28749 | L4_MABX_B.If_Then_Else_ob.XBREnduranceBrakeIntegrationMod = |
| 28750 | ENUM_XBR_EBI_MODE_T_NO_EBI_ALLOWED; |
| 28751 | L4_MABX_B.If_Then_Else_ob.XBRControlMode = |
| 28752 | ENUM_XBR_CONTROL_MODE_T_OVERRIDE_DISABLED; |
| 28753 | } |
| 28754 | |
| 28755 | /* exported global signals */ |
| 28756 | GLB_Absolute_Timestamp = 0.0; |
| 28757 | ReAX_ActualHandwheelPos = 0.0; |
| 28758 | EthernetLinkStatus = 0.0; |
| 28759 | CurrentAzimuth_rad = 0.0; |
| 28760 | TargetAzimuth_rad = 0.0; |
| 28761 | TargetVelocity_kph = 0.0; |
| 28762 | Curvature = 0.0; |
| 28763 | CrosstrackError = 0.0; |
| 28764 | CurrentVelocity_kph = 0.0; |
| 28765 | GPS_X = 0.0; |
| 28766 | GPS_Y = 0.0; |
| 28767 | GPS_Time = 0.0; |
| 28768 | ReAX_EchoedSteerWheelPos = 0.0; |
| 28769 | SteerWheelAngle = 0.0; |
| 28770 | YawRate = 0.0; |
| 28771 | SPN1810_LongitudinalAcceleration = 0.0; |
| 28772 | WheelBasedVehicleSpeed = 0.0; |
| 28773 | BrakeSwitch = 0.0; |
| 28774 | Lateral_Control_Rate_Limit = 0.0; |
| 28775 | Lateral_Control_Output = 0.0; |
| 28776 | Lateral_Control_Rate_Limiter_Output = 0.0; |
| 28777 | SteerCommandDeg = 0.0; |
| 28778 | DesiredSteeringAngle = 0.0; |
| 28779 | Lateral_Control_Heading_Error = 0.0; |
| 28780 | DIAG_CAN1_Count_Stuff_Errors = 0U; |
| 28781 | DIAG_CAN1_Count_Format_Errors = 0U; |
| 28782 | DIAG_CAN1_Count_Ack_Errors = 0U; |
| 28783 | DIAG_CAN1_Count_Bit0_Errors = 0U; |
| 28784 | DIAG_CAN1_Count_Bit1_Errors = 0U; |
| 28785 | DIAG_CAN1_Count_CRC_Errors = 0U; |
| 28786 | DIAG_CAN1_Count_RX_Lost = 0U; |
| 28787 | DIAG_CAN1_Count_RX_OK = 0U; |
| 28788 | DIAG_CAN1_Count_TX_OK = 0U; |
| 28789 | DIAG_CAN5_Count_Stuff_Errors = 0U; |
| 28790 | DIAG_CAN5_Count_Format_Errors = 0U; |
| 28791 | DIAG_CAN5_Count_Ack_Errors = 0U; |
| 28792 | DIAG_CAN5_Count_Bit0_Errors = 0U; |
| 28793 | DIAG_CAN5_Count_Bit1_Errors = 0U; |
| 28794 | DIAG_CAN5_Count_CRC_Errors = 0U; |
| 28795 | DIAG_CAN5_Count_RX_Lost = 0U; |
| 28796 | DIAG_CAN5_Count_RX_OK = 0U; |
| 28797 | DIAG_CAN5_Count_TX_OK = 0U; |
| 28798 | DIAG_CAN6_Count_Stuff_Errors = 0U; |
| 28799 | DIAG_CAN6_Count_Format_Errors = 0U; |
| 28800 | DIAG_CAN6_Count_Ack_Errors = 0U; |
| 28801 | DIAG_CAN6_Count_Bit0_Errors = 0U; |
| 28802 | DIAG_CAN6_Count_Bit1_Errors = 0U; |
| 28803 | DIAG_CAN6_Count_CRC_Errors = 0U; |
| 28804 | DIAG_CAN6_Count_RX_Lost = 0U; |
| 28805 | DIAG_CAN6_Count_RX_OK = 0U; |
| 28806 | DIAG_CAN6_Count_TX_OK = 0U; |
| 28807 | DIAG_CAN3_Count_Stuff_Errors = 0U; |
| 28808 | DIAG_CAN3_Count_Format_Errors = 0U; |
| 28809 | DIAG_CAN3_Count_Ack_Errors = 0U; |
| 28810 | DIAG_CAN3_Count_Bit0_Errors = 0U; |
| 28811 | DIAG_CAN3_Count_Bit1_Errors = 0U; |
| 28812 | DIAG_CAN3_Count_CRC_Errors = 0U; |
| 28813 | DIAG_CAN3_Count_RX_Lost = 0U; |
| 28814 | DIAG_CAN3_Count_RX_OK = 0U; |
| 28815 | DIAG_CAN3_Count_TX_OK = 0U; |
| 28816 | DIAG_CAN4_Count_Stuff_Errors = 0U; |
| 28817 | DIAG_CAN4_Count_Format_Errors = 0U; |
| 28818 | DIAG_CAN4_Count_Ack_Errors = 0U; |
| 28819 | DIAG_CAN4_Count_Bit0_Errors = 0U; |
| 28820 | DIAG_CAN4_Count_Bit1_Errors = 0U; |
| 28821 | DIAG_CAN4_Count_CRC_Errors = 0U; |
| 28822 | DIAG_CAN4_Count_RX_Lost = 0U; |
| 28823 | DIAG_CAN4_Count_RX_OK = 0U; |
| 28824 | DIAG_CAN4_Count_TX_OK = 0U; |
| 28825 | DIAG_CAN2_Count_Stuff_Errors = 0U; |
| 28826 | DIAG_CAN2_Count_Format_Errors = 0U; |
| 28827 | DIAG_CAN2_Count_Ack_Errors = 0U; |
| 28828 | DIAG_CAN2_Count_Bit0_Errors = 0U; |
| 28829 | DIAG_CAN2_Count_Bit1_Errors = 0U; |
| 28830 | DIAG_CAN2_Count_CRC_Errors = 0U; |
| 28831 | DIAG_CAN2_Count_RX_Lost = 0U; |
| 28832 | DIAG_CAN2_Count_RX_OK = 0U; |
| 28833 | DIAG_CAN2_Count_TX_OK = 0U; |
| 28834 | REAX_Handwheel_Torque = 0.0F; |
| 28835 | REAX_Handwheel_Velocity = 0.0F; |
| 28836 | REAX_Pull_Compensation = 0.0F; |
| 28837 | DIAG_CAN1_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE; |
| 28838 | DIAG_CAN5_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE; |
| 28839 | DIAG_CAN6_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE; |
| 28840 | DIAG_CAN3_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE; |
| 28841 | DIAG_CAN4_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE; |
| 28842 | DIAG_CAN2_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE; |
| 28843 | SupervisorMode = 0U; |
| 28844 | REAX_Current_Mode = 0U; |
| 28845 | REAX_Req_Mode = 0U; |
| 28846 | REAX_Status = 0U; |
| 28847 | |
| 28848 | { |
| 28849 | int32_T i; |
| 28850 | for (i = 0; i < 100; i++) { |
| 28851 | GLB_SWVERSION_CPV_[i] = ((uint8_T)0U); |
| 28852 | } |
| 28853 | } |
| 28854 | |
| 28855 | MABX_Mode = 0U; |
| 28856 | EStop = false; |
| 28857 | EnableSw = false; |
| 28858 | EngagePB = false; |
| 28859 | BrakeSW = false; |
| 28860 | MABX_Heartbeat = false; |
| 28861 | Heartbeat_Ok = false; |
| 28862 | RTMapsOk = false; |
| 28863 | LogEventPB = false; |
| 28864 | EngageReq = false; |
| 28865 | AutonomousEnabled = false; |
| 28866 | AutonomousOutputEnabled = false; |
| 28867 | RateLimiterActive = false; |
| 28868 | Pedal_pwm_position = 0.0; |
| 28869 | |
| 28870 | /* states (dwork) */ |
| 28871 | (void) memset((void *)&L4_MABX_DW, 0, |
| 28872 | sizeof(DW_L4_MABX_T)); |
| 28873 | |
| 28874 | /* child S-Function registration */ |
| 28875 | { |
| 28876 | RTWSfcnInfo *sfcnInfo = &L4_MABX_M->NonInlinedSFcns.sfcnInfo; |
| 28877 | L4_MABX_M->sfcnInfo = (sfcnInfo); |
| 28878 | rtssSetErrorStatusPtr(sfcnInfo, (&rtmGetErrorStatus(L4_MABX_M))); |
| 28879 | rtssSetNumRootSampTimesPtr(sfcnInfo, &L4_MABX_M->Sizes.numSampTimes); |
| 28880 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[0] = &(rtmGetTPtr(L4_MABX_M)[0]); |
| 28881 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[1] = &(rtmGetTPtr(L4_MABX_M)[1]); |
| 28882 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[2] = &(rtmGetTPtr(L4_MABX_M)[2]); |
| 28883 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[3] = &(rtmGetTPtr(L4_MABX_M)[3]); |
| 28884 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[4] = &(rtmGetTPtr(L4_MABX_M)[4]); |
| 28885 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[5] = &(rtmGetTPtr(L4_MABX_M)[5]); |
| 28886 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[6] = &(rtmGetTPtr(L4_MABX_M)[6]); |
| 28887 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[7] = &(rtmGetTPtr(L4_MABX_M)[7]); |
| 28888 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[8] = &(rtmGetTPtr(L4_MABX_M)[8]); |
| 28889 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[9] = &(rtmGetTPtr(L4_MABX_M)[9]); |
| 28890 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[10] = &(rtmGetTPtr(L4_MABX_M)[10]); |
| 28891 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[11] = &(rtmGetTPtr(L4_MABX_M)[11]); |
| 28892 | L4_MABX_M->NonInlinedSFcns.taskTimePtrs[12] = &(rtmGetTPtr(L4_MABX_M)[12]); |
| 28893 | rtssSetTPtrPtr(sfcnInfo,L4_MABX_M->NonInlinedSFcns.taskTimePtrs); |
| 28894 | rtssSetTStartPtr(sfcnInfo, &rtmGetTStart(L4_MABX_M)); |
| 28895 | rtssSetTFinalPtr(sfcnInfo, &rtmGetTFinal(L4_MABX_M)); |
| 28896 | rtssSetTimeOfLastOutputPtr(sfcnInfo, &rtmGetTimeOfLastOutput(L4_MABX_M)); |
| 28897 | rtssSetStepSizePtr(sfcnInfo, &L4_MABX_M->Timing.stepSize); |
| 28898 | rtssSetStopRequestedPtr(sfcnInfo, &rtmGetStopRequested(L4_MABX_M)); |
| 28899 | rtssSetDerivCacheNeedsResetPtr(sfcnInfo, &L4_MABX_M->derivCacheNeedsReset); |
| 28900 | rtssSetZCCacheNeedsResetPtr(sfcnInfo, &L4_MABX_M->zCCacheNeedsReset); |
| 28901 | rtssSetContTimeOutputInconsistentWithStateAtMajorStepPtr(sfcnInfo, |
| 28902 | &L4_MABX_M->CTOutputIncnstWithState); |
| 28903 | rtssSetSampleHitsPtr(sfcnInfo, &L4_MABX_M->Timing.sampleHits); |
| 28904 | rtssSetPerTaskSampleHitsPtr(sfcnInfo, &L4_MABX_M->Timing.perTaskSampleHits); |
| 28905 | rtssSetSimModePtr(sfcnInfo, &L4_MABX_M->simMode); |
| 28906 | rtssSetSolverInfoPtr(sfcnInfo, &L4_MABX_M->solverInfoPtr); |
| 28907 | } |
| 28908 | |
| 28909 | L4_MABX_M->Sizes.numSFcns = (5); |
| 28910 | |
| 28911 | /* register each child */ |
| 28912 | { |
| 28913 | (void) memset((void *)&L4_MABX_M->NonInlinedSFcns.childSFunctions[0], 0, |
| 28914 | 5*sizeof(SimStruct)); |
| 28915 | L4_MABX_M->childSfunctions = (&L4_MABX_M-> |
| 28916 | NonInlinedSFcns.childSFunctionPtrs[0]); |
| 28917 | |
| 28918 | { |
| 28919 | int_T i; |
| 28920 | for (i = 0; i < 5; i++) { |
| 28921 | L4_MABX_M->childSfunctions[i] = |
| 28922 | (&L4_MABX_M->NonInlinedSFcns.childSFunctions[i]); |
| 28923 | } |
| 28924 | } |
| 28925 | |
| 28926 | /* Level2 S-Function Block: L4_MABX/<S409>/dsa_tcpip_bkg_sfcn (dsa_tcpip_bkg_sfcn) */ |
| 28927 | { |
| 28928 | SimStruct *rts = L4_MABX_M->childSfunctions[0]; |
| 28929 | |
| 28930 | /* timing info */ |
| 28931 | time_T *sfcnPeriod = L4_MABX_M->NonInlinedSFcns.Sfcn0.sfcnPeriod; |
| 28932 | time_T *sfcnOffset = L4_MABX_M->NonInlinedSFcns.Sfcn0.sfcnOffset; |
| 28933 | int_T *sfcnTsMap = L4_MABX_M->NonInlinedSFcns.Sfcn0.sfcnTsMap; |
| 28934 | (void) memset((void*)sfcnPeriod, 0, |
| 28935 | sizeof(time_T)*1); |
| 28936 | (void) memset((void*)sfcnOffset, 0, |
| 28937 | sizeof(time_T)*1); |
| 28938 | ssSetSampleTimePtr(rts, &sfcnPeriod[0]); |
| 28939 | ssSetOffsetTimePtr(rts, &sfcnOffset[0]); |
| 28940 | ssSetSampleTimeTaskIDPtr(rts, sfcnTsMap); |
| 28941 | |
| 28942 | { |
| 28943 | ssSetBlkInfo2Ptr(rts, &L4_MABX_M->NonInlinedSFcns.blkInfo2[0]); |
| 28944 | } |
| 28945 | |
| 28946 | _ssSetBlkInfo2PortInfo2Ptr(rts, |
| 28947 | &L4_MABX_M->NonInlinedSFcns.inputOutputPortInfo2[0]); |
| 28948 | |
| 28949 | /* Set up the mdlInfo pointer */ |
| 28950 | ssSetRTWSfcnInfo(rts, L4_MABX_M->sfcnInfo); |
| 28951 | |
| 28952 | /* Allocate memory of model methods 2 */ |
| 28953 | { |
| 28954 | ssSetModelMethods2(rts, &L4_MABX_M->NonInlinedSFcns.methods2[0]); |
| 28955 | } |
| 28956 | |
| 28957 | /* Allocate memory of model methods 3 */ |
| 28958 | { |
| 28959 | ssSetModelMethods3(rts, &L4_MABX_M->NonInlinedSFcns.methods3[0]); |
| 28960 | } |
| 28961 | |
| 28962 | /* Allocate memory of model methods 4 */ |
| 28963 | { |
| 28964 | ssSetModelMethods4(rts, &L4_MABX_M->NonInlinedSFcns.methods4[0]); |
| 28965 | } |
| 28966 | |
| 28967 | /* Allocate memory for states auxilliary information */ |
| 28968 | { |
| 28969 | ssSetStatesInfo2(rts, &L4_MABX_M->NonInlinedSFcns.statesInfo2[0]); |
| 28970 | ssSetPeriodicStatesInfo(rts, |
| 28971 | &L4_MABX_M->NonInlinedSFcns.periodicStatesInfo[0]); |
| 28972 | } |
| 28973 | |
| 28974 | /* path info */ |
| 28975 | ssSetModelName(rts, "dsa_tcpip_bkg_sfcn"); |
| 28976 | ssSetPath(rts, |
| 28977 | "L4_MABX/ETHERNET/TCPIP_Setup/Background_Task/dsa_tcpip_bkg_sfcn"); |
| 28978 | ssSetRTModel(rts,L4_MABX_M); |
| 28979 | ssSetParentSS(rts, (NULL)); |
| 28980 | ssSetRootSS(rts, rts); |
| 28981 | ssSetVersion(rts, SIMSTRUCT_VERSION_LEVEL2); |
| 28982 | |
| 28983 | /* work vectors */ |
| 28984 | ssSetIWork(rts, (int_T *) &L4_MABX_DW.dsa_tcpip_bkg_sfcn_IWORK); |
| 28985 | |
| 28986 | { |
| 28987 | struct _ssDWorkRecord *dWorkRecord = (struct _ssDWorkRecord *) |
| 28988 | &L4_MABX_M->NonInlinedSFcns.Sfcn0.dWork; |
| 28989 | struct _ssDWorkAuxRecord *dWorkAuxRecord = (struct _ssDWorkAuxRecord *) |
| 28990 | &L4_MABX_M->NonInlinedSFcns.Sfcn0.dWorkAux; |
| 28991 | ssSetSFcnDWork(rts, dWorkRecord); |
| 28992 | ssSetSFcnDWorkAux(rts, dWorkAuxRecord); |
| 28993 | _ssSetNumDWork(rts, 1); |
| 28994 | |
| 28995 | /* IWORK */ |
| 28996 | ssSetDWorkWidth(rts, 0, 1); |
| 28997 | ssSetDWorkDataType(rts, 0,SS_INTEGER); |
| 28998 | ssSetDWorkComplexSignal(rts, 0, 0); |
| 28999 | ssSetDWork(rts, 0, &L4_MABX_DW.dsa_tcpip_bkg_sfcn_IWORK); |
| 29000 | } |
| 29001 | |
| 29002 | /* registration */ |
| 29003 | dsa_tcpip_bkg_sfcn(rts); |
| 29004 | sfcnInitializeSizes(rts); |
| 29005 | sfcnInitializeSampleTimes(rts); |
| 29006 | |
| 29007 | /* adjust sample time */ |
| 29008 | ssSetSampleTime(rts, 0, -1.0); |
| 29009 | ssSetOffsetTime(rts, 0, -2.0); |
| 29010 | sfcnTsMap[0] = 9; |
| 29011 | |
| 29012 | /* set compiled values of dynamic vector attributes */ |
| 29013 | ssSetNumNonsampledZCs(rts, 0); |
| 29014 | |
| 29015 | /* Update connectivity flags for each port */ |
| 29016 | /* Update the BufferDstPort flags for each input port */ |
| 29017 | } |
| 29018 | |
| 29019 | /* Level2 S-Function Block: L4_MABX/<S410>/dsa_tcpip_irq_l2_sfcn (dsa_tcpip_irq_l2_sfcn) */ |
| 29020 | { |
| 29021 | SimStruct *rts = L4_MABX_M->childSfunctions[1]; |
| 29022 | |
| 29023 | /* timing info */ |
| 29024 | time_T *sfcnPeriod = L4_MABX_M->NonInlinedSFcns.Sfcn1.sfcnPeriod; |
| 29025 | time_T *sfcnOffset = L4_MABX_M->NonInlinedSFcns.Sfcn1.sfcnOffset; |
| 29026 | int_T *sfcnTsMap = L4_MABX_M->NonInlinedSFcns.Sfcn1.sfcnTsMap; |
| 29027 | (void) memset((void*)sfcnPeriod, 0, |
| 29028 | sizeof(time_T)*1); |
| 29029 | (void) memset((void*)sfcnOffset, 0, |
| 29030 | sizeof(time_T)*1); |
| 29031 | ssSetSampleTimePtr(rts, &sfcnPeriod[0]); |
| 29032 | ssSetOffsetTimePtr(rts, &sfcnOffset[0]); |
| 29033 | ssSetSampleTimeTaskIDPtr(rts, sfcnTsMap); |
| 29034 | |
| 29035 | { |
| 29036 | ssSetBlkInfo2Ptr(rts, &L4_MABX_M->NonInlinedSFcns.blkInfo2[1]); |
| 29037 | } |
| 29038 | |
| 29039 | _ssSetBlkInfo2PortInfo2Ptr(rts, |
| 29040 | &L4_MABX_M->NonInlinedSFcns.inputOutputPortInfo2[1]); |
| 29041 | |
| 29042 | /* Set up the mdlInfo pointer */ |
| 29043 | ssSetRTWSfcnInfo(rts, L4_MABX_M->sfcnInfo); |
| 29044 | |
| 29045 | /* Allocate memory of model methods 2 */ |
| 29046 | { |
| 29047 | ssSetModelMethods2(rts, &L4_MABX_M->NonInlinedSFcns.methods2[1]); |
| 29048 | } |
| 29049 | |
| 29050 | /* Allocate memory of model methods 3 */ |
| 29051 | { |
| 29052 | ssSetModelMethods3(rts, &L4_MABX_M->NonInlinedSFcns.methods3[1]); |
| 29053 | } |
| 29054 | |
| 29055 | /* Allocate memory of model methods 4 */ |
| 29056 | { |
| 29057 | ssSetModelMethods4(rts, &L4_MABX_M->NonInlinedSFcns.methods4[1]); |
| 29058 | } |
| 29059 | |
| 29060 | /* Allocate memory for states auxilliary information */ |
| 29061 | { |
| 29062 | ssSetStatesInfo2(rts, &L4_MABX_M->NonInlinedSFcns.statesInfo2[1]); |
| 29063 | ssSetPeriodicStatesInfo(rts, |
| 29064 | &L4_MABX_M->NonInlinedSFcns.periodicStatesInfo[1]); |
| 29065 | } |
| 29066 | |
| 29067 | /* path info */ |
| 29068 | ssSetModelName(rts, "dsa_tcpip_irq_l2_sfcn"); |
| 29069 | ssSetPath(rts, |
| 29070 | "L4_MABX/ETHERNET/TCPIP_Setup/IRQ_Level_2_SW_INT/dsa_tcpip_irq_l2_sfcn"); |
| 29071 | ssSetRTModel(rts,L4_MABX_M); |
| 29072 | ssSetParentSS(rts, (NULL)); |
| 29073 | ssSetRootSS(rts, rts); |
| 29074 | ssSetVersion(rts, SIMSTRUCT_VERSION_LEVEL2); |
| 29075 | |
| 29076 | /* registration */ |
| 29077 | dsa_tcpip_irq_l2_sfcn(rts); |
| 29078 | sfcnInitializeSizes(rts); |
| 29079 | sfcnInitializeSampleTimes(rts); |
| 29080 | |
| 29081 | /* adjust sample time */ |
| 29082 | ssSetSampleTime(rts, 0, -1.0); |
| 29083 | ssSetOffsetTime(rts, 0, -3.0); |
| 29084 | sfcnTsMap[0] = 10; |
| 29085 | |
| 29086 | /* set compiled values of dynamic vector attributes */ |
| 29087 | ssSetNumNonsampledZCs(rts, 0); |
| 29088 | |
| 29089 | /* Update connectivity flags for each port */ |
| 29090 | /* Update the BufferDstPort flags for each input port */ |
| 29091 | } |
| 29092 | |
| 29093 | /* Level2 S-Function Block: L4_MABX/<S411>/dsa_tcpip_irq_l1_sfcn (dsa_tcpip_irq_l1_sfcn) */ |
| 29094 | { |
| 29095 | SimStruct *rts = L4_MABX_M->childSfunctions[2]; |
| 29096 | |
| 29097 | /* timing info */ |
| 29098 | time_T *sfcnPeriod = L4_MABX_M->NonInlinedSFcns.Sfcn2.sfcnPeriod; |
| 29099 | time_T *sfcnOffset = L4_MABX_M->NonInlinedSFcns.Sfcn2.sfcnOffset; |
| 29100 | int_T *sfcnTsMap = L4_MABX_M->NonInlinedSFcns.Sfcn2.sfcnTsMap; |
| 29101 | (void) memset((void*)sfcnPeriod, 0, |
| 29102 | sizeof(time_T)*1); |
| 29103 | (void) memset((void*)sfcnOffset, 0, |
| 29104 | sizeof(time_T)*1); |
| 29105 | ssSetSampleTimePtr(rts, &sfcnPeriod[0]); |
| 29106 | ssSetOffsetTimePtr(rts, &sfcnOffset[0]); |
| 29107 | ssSetSampleTimeTaskIDPtr(rts, sfcnTsMap); |
| 29108 | |
| 29109 | { |
| 29110 | ssSetBlkInfo2Ptr(rts, &L4_MABX_M->NonInlinedSFcns.blkInfo2[2]); |
| 29111 | } |
| 29112 | |
| 29113 | _ssSetBlkInfo2PortInfo2Ptr(rts, |
| 29114 | &L4_MABX_M->NonInlinedSFcns.inputOutputPortInfo2[2]); |
| 29115 | |
| 29116 | /* Set up the mdlInfo pointer */ |
| 29117 | ssSetRTWSfcnInfo(rts, L4_MABX_M->sfcnInfo); |
| 29118 | |
| 29119 | /* Allocate memory of model methods 2 */ |
| 29120 | { |
| 29121 | ssSetModelMethods2(rts, &L4_MABX_M->NonInlinedSFcns.methods2[2]); |
| 29122 | } |
| 29123 | |
| 29124 | /* Allocate memory of model methods 3 */ |
| 29125 | { |
| 29126 | ssSetModelMethods3(rts, &L4_MABX_M->NonInlinedSFcns.methods3[2]); |
| 29127 | } |
| 29128 | |
| 29129 | /* Allocate memory of model methods 4 */ |
| 29130 | { |
| 29131 | ssSetModelMethods4(rts, &L4_MABX_M->NonInlinedSFcns.methods4[2]); |
| 29132 | } |
| 29133 | |
| 29134 | /* Allocate memory for states auxilliary information */ |
| 29135 | { |
| 29136 | ssSetStatesInfo2(rts, &L4_MABX_M->NonInlinedSFcns.statesInfo2[2]); |
| 29137 | ssSetPeriodicStatesInfo(rts, |
| 29138 | &L4_MABX_M->NonInlinedSFcns.periodicStatesInfo[2]); |
| 29139 | } |
| 29140 | |
| 29141 | /* outputs */ |
| 29142 | { |
| 29143 | ssSetPortInfoForOutputs(rts, |
| 29144 | &L4_MABX_M->NonInlinedSFcns.Sfcn2.outputPortInfo[0]); |
| 29145 | _ssSetNumOutputPorts(rts, 1); |
| 29146 | _ssSetPortInfo2ForOutputUnits(rts, |
| 29147 | &L4_MABX_M->NonInlinedSFcns.Sfcn2.outputPortUnits[0]); |
| 29148 | ssSetOutputPortUnit(rts, 0, 0); |
| 29149 | _ssSetPortInfo2ForOutputCoSimAttribute(rts, |
| 29150 | &L4_MABX_M->NonInlinedSFcns.Sfcn2.outputPortCoSimAttribute[0]); |
| 29151 | ssSetOutputPortIsContinuousQuantity(rts, 0, 0); |
| 29152 | |
| 29153 | /* port 0 */ |
| 29154 | { |
| 29155 | _ssSetOutputPortNumDimensions(rts, 0, 1); |
| 29156 | ssSetOutputPortWidth(rts, 0, 1); |
| 29157 | ssSetOutputPortSignal(rts, 0, (NULL)); |
| 29158 | } |
| 29159 | } |
| 29160 | |
| 29161 | /* path info */ |
| 29162 | ssSetModelName(rts, "dsa_tcpip_irq_l1_sfcn"); |
| 29163 | ssSetPath(rts, |
| 29164 | "L4_MABX/ETHERNET/TCPIP_Setup/Interrupt_Task/dsa_tcpip_irq_l1_sfcn"); |
| 29165 | ssSetRTModel(rts,L4_MABX_M); |
| 29166 | ssSetParentSS(rts, (NULL)); |
| 29167 | ssSetRootSS(rts, rts); |
| 29168 | ssSetVersion(rts, SIMSTRUCT_VERSION_LEVEL2); |
| 29169 | |
| 29170 | /* register function-calls */ |
| 29171 | { |
| 29172 | int_T *callSysOutputs = (int_T *) |
| 29173 | &L4_MABX_M->NonInlinedSFcns.Sfcn2.callSysOutputs; |
| 29174 | void **callSysArgs1 = (void **) |
| 29175 | &L4_MABX_M->NonInlinedSFcns.Sfcn2.callSysArgs1; |
| 29176 | int_T *callSysArgs2 = (int_T *) |
| 29177 | &L4_MABX_M->NonInlinedSFcns.Sfcn2.callSysArgs2; |
| 29178 | SysOutputFcn *callSysFcns = (SysOutputFcn *) |
| 29179 | &L4_MABX_M->NonInlinedSFcns.Sfcn2.callSysFcns; |
| 29180 | |
| 29181 | { |
| 29182 | int32_T i; |
| 29183 | for (i = 0; i < 1; i++) { |
| 29184 | callSysOutputs[i] = 0; |
| 29185 | callSysFcns[i] = (SysOutputFcn) (NULL); |
| 29186 | callSysFcns[1+i] = (SysOutputFcn) (NULL); |
| 29187 | callSysFcns[2*1+i] = (SysOutputFcn) (NULL); |
| 29188 | callSysFcns[3*1+i] = (SysOutputFcn) (NULL); |
| 29189 | } |
| 29190 | } |
| 29191 | |
| 29192 | ssSetCallSystemOutputPtr(rts, &callSysOutputs[0]); |
| 29193 | ssSetCallSystemOutputArg1List(rts, &callSysArgs1[0]); |
| 29194 | ssSetCallSystemOutputArg2List(rts, &callSysArgs2[0]); |
| 29195 | ssSetCallSystemOutputFcnList(rts, &callSysFcns[0]); |
| 29196 | callSysArgs1[0] = (void *)L4_MABX_M; |
| 29197 | callSysArgs2[0] = 0; |
| 29198 | callSysFcns[0] = (SysOutputFcn) L4_MABX_TcpInputProcessingFNI; |
| 29199 | callSysFcns[1+0] = (SysOutputFcn) L4_TcpInputProcessing_ResetFNI; |
| 29200 | callSysFcns[2+0] = (SysOutputFcn) (NULL); |
| 29201 | callSysFcns[3+0] = (SysOutputFcn) (NULL); |
| 29202 | callSysOutputs[0] = 1; |
| 29203 | } |
| 29204 | |
| 29205 | /* registration */ |
| 29206 | dsa_tcpip_irq_l1_sfcn(rts); |
| 29207 | sfcnInitializeSizes(rts); |
| 29208 | sfcnInitializeSampleTimes(rts); |
| 29209 | |
| 29210 | /* adjust sample time */ |
| 29211 | ssSetSampleTime(rts, 0, -1.0); |
| 29212 | ssSetOffsetTime(rts, 0, -4.0); |
| 29213 | sfcnTsMap[0] = 11; |
| 29214 | |
| 29215 | /* set compiled values of dynamic vector attributes */ |
| 29216 | ssSetOutputPortWidth(rts, 0, 1); |
| 29217 | ssSetNumNonsampledZCs(rts, 0); |
| 29218 | |
| 29219 | /* Update connectivity flags for each port */ |
| 29220 | _ssSetOutputPortConnected(rts, 0, 1); |
| 29221 | _ssSetOutputPortBeingMerged(rts, 0, 0); |
| 29222 | |
| 29223 | /* Update the BufferDstPort flags for each input port */ |
| 29224 | } |
| 29225 | |
| 29226 | /* Level2 S-Function Block: L4_MABX/<S399>/dsa_tcpip_setup (dsa_tcpip_setup_sfcn) */ |
| 29227 | { |
| 29228 | SimStruct *rts = L4_MABX_M->childSfunctions[3]; |
| 29229 | |
| 29230 | /* timing info */ |
| 29231 | time_T *sfcnPeriod = L4_MABX_M->NonInlinedSFcns.Sfcn3.sfcnPeriod; |
| 29232 | time_T *sfcnOffset = L4_MABX_M->NonInlinedSFcns.Sfcn3.sfcnOffset; |
| 29233 | int_T *sfcnTsMap = L4_MABX_M->NonInlinedSFcns.Sfcn3.sfcnTsMap; |
| 29234 | (void) memset((void*)sfcnPeriod, 0, |
| 29235 | sizeof(time_T)*1); |
| 29236 | (void) memset((void*)sfcnOffset, 0, |
| 29237 | sizeof(time_T)*1); |
| 29238 | ssSetSampleTimePtr(rts, &sfcnPeriod[0]); |
| 29239 | ssSetOffsetTimePtr(rts, &sfcnOffset[0]); |
| 29240 | ssSetSampleTimeTaskIDPtr(rts, sfcnTsMap); |
| 29241 | |
| 29242 | { |
| 29243 | ssSetBlkInfo2Ptr(rts, &L4_MABX_M->NonInlinedSFcns.blkInfo2[3]); |
| 29244 | } |
| 29245 | |
| 29246 | _ssSetBlkInfo2PortInfo2Ptr(rts, |
| 29247 | &L4_MABX_M->NonInlinedSFcns.inputOutputPortInfo2[3]); |
| 29248 | |
| 29249 | /* Set up the mdlInfo pointer */ |
| 29250 | ssSetRTWSfcnInfo(rts, L4_MABX_M->sfcnInfo); |
| 29251 | |
| 29252 | /* Allocate memory of model methods 2 */ |
| 29253 | { |
| 29254 | ssSetModelMethods2(rts, &L4_MABX_M->NonInlinedSFcns.methods2[3]); |
| 29255 | } |
| 29256 | |
| 29257 | /* Allocate memory of model methods 3 */ |
| 29258 | { |
| 29259 | ssSetModelMethods3(rts, &L4_MABX_M->NonInlinedSFcns.methods3[3]); |
| 29260 | } |
| 29261 | |
| 29262 | /* Allocate memory of model methods 4 */ |
| 29263 | { |
| 29264 | ssSetModelMethods4(rts, &L4_MABX_M->NonInlinedSFcns.methods4[3]); |
| 29265 | } |
| 29266 | |
| 29267 | /* Allocate memory for states auxilliary information */ |
| 29268 | { |
| 29269 | ssSetStatesInfo2(rts, &L4_MABX_M->NonInlinedSFcns.statesInfo2[3]); |
| 29270 | ssSetPeriodicStatesInfo(rts, |
| 29271 | &L4_MABX_M->NonInlinedSFcns.periodicStatesInfo[3]); |
| 29272 | } |
| 29273 | |
| 29274 | /* outputs */ |
| 29275 | { |
| 29276 | ssSetPortInfoForOutputs(rts, |
| 29277 | &L4_MABX_M->NonInlinedSFcns.Sfcn3.outputPortInfo[0]); |
| 29278 | _ssSetNumOutputPorts(rts, 1); |
| 29279 | _ssSetPortInfo2ForOutputUnits(rts, |
| 29280 | &L4_MABX_M->NonInlinedSFcns.Sfcn3.outputPortUnits[0]); |
| 29281 | ssSetOutputPortUnit(rts, 0, 0); |
| 29282 | _ssSetPortInfo2ForOutputCoSimAttribute(rts, |
| 29283 | &L4_MABX_M->NonInlinedSFcns.Sfcn3.outputPortCoSimAttribute[0]); |
| 29284 | ssSetOutputPortIsContinuousQuantity(rts, 0, 0); |
| 29285 | |
| 29286 | /* port 0 */ |
| 29287 | { |
| 29288 | _ssSetOutputPortNumDimensions(rts, 0, 1); |
| 29289 | ssSetOutputPortWidth(rts, 0, 1); |
| 29290 | ssSetOutputPortSignal(rts, 0, ((real_T *) &EthernetLinkStatus)); |
| 29291 | } |
| 29292 | } |
| 29293 | |
| 29294 | /* path info */ |
| 29295 | ssSetModelName(rts, "dsa_tcpip_setup"); |
| 29296 | ssSetPath(rts, "L4_MABX/ETHERNET/TCPIP_Setup/dsa_tcpip_setup"); |
| 29297 | ssSetRTModel(rts,L4_MABX_M); |
| 29298 | ssSetParentSS(rts, (NULL)); |
| 29299 | ssSetRootSS(rts, rts); |
| 29300 | ssSetVersion(rts, SIMSTRUCT_VERSION_LEVEL2); |
| 29301 | |
| 29302 | /* parameters */ |
| 29303 | { |
| 29304 | mxArray **sfcnParams = (mxArray **) |
| 29305 | &L4_MABX_M->NonInlinedSFcns.Sfcn3.params; |
| 29306 | ssSetSFcnParamsCount(rts, 6); |
| 29307 | ssSetSFcnParamsPtr(rts, &sfcnParams[0]); |
| 29308 | ssSetSFcnParam(rts, 0, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P1_Size); |
| 29309 | ssSetSFcnParam(rts, 1, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P2_Size); |
| 29310 | ssSetSFcnParam(rts, 2, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P3_Size); |
| 29311 | ssSetSFcnParam(rts, 3, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P4_Size); |
| 29312 | ssSetSFcnParam(rts, 4, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P5_Size); |
| 29313 | ssSetSFcnParam(rts, 5, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P6_Size); |
| 29314 | } |
| 29315 | |
| 29316 | /* work vectors */ |
| 29317 | ssSetIWork(rts, (int_T *) &L4_MABX_DW.dsa_tcpip_setup_IWORK); |
| 29318 | ssSetPWork(rts, (void **) &L4_MABX_DW.dsa_tcpip_setup_PWORK); |
| 29319 | |
| 29320 | { |
| 29321 | struct _ssDWorkRecord *dWorkRecord = (struct _ssDWorkRecord *) |
| 29322 | &L4_MABX_M->NonInlinedSFcns.Sfcn3.dWork; |
| 29323 | struct _ssDWorkAuxRecord *dWorkAuxRecord = (struct _ssDWorkAuxRecord *) |
| 29324 | &L4_MABX_M->NonInlinedSFcns.Sfcn3.dWorkAux; |
| 29325 | ssSetSFcnDWork(rts, dWorkRecord); |
| 29326 | ssSetSFcnDWorkAux(rts, dWorkAuxRecord); |
| 29327 | _ssSetNumDWork(rts, 2); |
| 29328 | |
| 29329 | /* IWORK */ |
| 29330 | ssSetDWorkWidth(rts, 0, 1); |
| 29331 | ssSetDWorkDataType(rts, 0,SS_INTEGER); |
| 29332 | ssSetDWorkComplexSignal(rts, 0, 0); |
| 29333 | ssSetDWork(rts, 0, &L4_MABX_DW.dsa_tcpip_setup_IWORK); |
| 29334 | |
| 29335 | /* PWORK */ |
| 29336 | ssSetDWorkWidth(rts, 1, 1); |
| 29337 | ssSetDWorkDataType(rts, 1,SS_POINTER); |
| 29338 | ssSetDWorkComplexSignal(rts, 1, 0); |
| 29339 | ssSetDWork(rts, 1, &L4_MABX_DW.dsa_tcpip_setup_PWORK); |
| 29340 | } |
| 29341 | |
| 29342 | /* registration */ |
| 29343 | dsa_tcpip_setup_sfcn(rts); |
| 29344 | sfcnInitializeSizes(rts); |
| 29345 | sfcnInitializeSampleTimes(rts); |
| 29346 | |
| 29347 | /* adjust sample time */ |
| 29348 | ssSetSampleTime(rts, 0, 0.01); |
| 29349 | ssSetOffsetTime(rts, 0, 0.0); |
| 29350 | sfcnTsMap[0] = 0; |
| 29351 | |
| 29352 | /* set compiled values of dynamic vector attributes */ |
| 29353 | ssSetNumNonsampledZCs(rts, 0); |
| 29354 | |
| 29355 | /* Update connectivity flags for each port */ |
| 29356 | _ssSetOutputPortConnected(rts, 0, 1); |
| 29357 | _ssSetOutputPortBeingMerged(rts, 0, 0); |
| 29358 | |
| 29359 | /* Update the BufferDstPort flags for each input port */ |
| 29360 | } |
| 29361 | |
| 29362 | /* Level2 S-Function Block: L4_MABX/<S400>/TCPIP_Com (dsa_tcpip_udp_sfcn) */ |
| 29363 | { |
| 29364 | SimStruct *rts = L4_MABX_M->childSfunctions[4]; |
| 29365 | |
| 29366 | /* timing info */ |
| 29367 | time_T *sfcnPeriod = L4_MABX_M->NonInlinedSFcns.Sfcn4.sfcnPeriod; |
| 29368 | time_T *sfcnOffset = L4_MABX_M->NonInlinedSFcns.Sfcn4.sfcnOffset; |
| 29369 | int_T *sfcnTsMap = L4_MABX_M->NonInlinedSFcns.Sfcn4.sfcnTsMap; |
| 29370 | (void) memset((void*)sfcnPeriod, 0, |
| 29371 | sizeof(time_T)*1); |
| 29372 | (void) memset((void*)sfcnOffset, 0, |
| 29373 | sizeof(time_T)*1); |
| 29374 | ssSetSampleTimePtr(rts, &sfcnPeriod[0]); |
| 29375 | ssSetOffsetTimePtr(rts, &sfcnOffset[0]); |
| 29376 | ssSetSampleTimeTaskIDPtr(rts, sfcnTsMap); |
| 29377 | |
| 29378 | { |
| 29379 | ssSetBlkInfo2Ptr(rts, &L4_MABX_M->NonInlinedSFcns.blkInfo2[4]); |
| 29380 | } |
| 29381 | |
| 29382 | _ssSetBlkInfo2PortInfo2Ptr(rts, |
| 29383 | &L4_MABX_M->NonInlinedSFcns.inputOutputPortInfo2[4]); |
| 29384 | |
| 29385 | /* Set up the mdlInfo pointer */ |
| 29386 | ssSetRTWSfcnInfo(rts, L4_MABX_M->sfcnInfo); |
| 29387 | |
| 29388 | /* Allocate memory of model methods 2 */ |
| 29389 | { |
| 29390 | ssSetModelMethods2(rts, &L4_MABX_M->NonInlinedSFcns.methods2[4]); |
| 29391 | } |
| 29392 | |
| 29393 | /* Allocate memory of model methods 3 */ |
| 29394 | { |
| 29395 | ssSetModelMethods3(rts, &L4_MABX_M->NonInlinedSFcns.methods3[4]); |
| 29396 | } |
| 29397 | |
| 29398 | /* Allocate memory of model methods 4 */ |
| 29399 | { |
| 29400 | ssSetModelMethods4(rts, &L4_MABX_M->NonInlinedSFcns.methods4[4]); |
| 29401 | } |
| 29402 | |
| 29403 | /* Allocate memory for states auxilliary information */ |
| 29404 | { |
| 29405 | ssSetStatesInfo2(rts, &L4_MABX_M->NonInlinedSFcns.statesInfo2[4]); |
| 29406 | ssSetPeriodicStatesInfo(rts, |
| 29407 | &L4_MABX_M->NonInlinedSFcns.periodicStatesInfo[4]); |
| 29408 | } |
| 29409 | |
| 29410 | /* inputs */ |
| 29411 | { |
| 29412 | _ssSetNumInputPorts(rts, 3); |
| 29413 | ssSetPortInfoForInputs(rts, |
| 29414 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.inputPortInfo[0]); |
| 29415 | _ssSetPortInfo2ForInputUnits(rts, |
| 29416 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.inputPortUnits[0]); |
| 29417 | ssSetInputPortUnit(rts, 0, 0); |
| 29418 | ssSetInputPortUnit(rts, 1, 0); |
| 29419 | ssSetInputPortUnit(rts, 2, 0); |
| 29420 | _ssSetPortInfo2ForInputCoSimAttribute(rts, |
| 29421 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.inputPortCoSimAttribute[0]); |
| 29422 | ssSetInputPortIsContinuousQuantity(rts, 0, 0); |
| 29423 | ssSetInputPortIsContinuousQuantity(rts, 1, 0); |
| 29424 | ssSetInputPortIsContinuousQuantity(rts, 2, 0); |
| 29425 | |
| 29426 | /* port 0 */ |
| 29427 | { |
| 29428 | boolean_T const **sfcnUPtrs = (boolean_T const **) |
| 29429 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.UPtrs0; |
| 29430 | sfcnUPtrs[0] = &L4_MABX_B.Enable; |
| 29431 | ssSetInputPortSignalPtrs(rts, 0, (InputPtrsType)&sfcnUPtrs[0]); |
| 29432 | _ssSetInputPortNumDimensions(rts, 0, 1); |
| 29433 | ssSetInputPortWidth(rts, 0, 1); |
| 29434 | } |
| 29435 | |
| 29436 | /* port 1 */ |
| 29437 | { |
| 29438 | uint32_T const **sfcnUPtrs = (uint32_T const **) |
| 29439 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.UPtrs1; |
| 29440 | sfcnUPtrs[0] = &L4_MABX_B.Encoder_o2; |
| 29441 | ssSetInputPortSignalPtrs(rts, 1, (InputPtrsType)&sfcnUPtrs[0]); |
| 29442 | _ssSetInputPortNumDimensions(rts, 1, 1); |
| 29443 | ssSetInputPortWidth(rts, 1, 1); |
| 29444 | } |
| 29445 | |
| 29446 | /* port 2 */ |
| 29447 | { |
| 29448 | uint8_T const **sfcnUPtrs = (uint8_T const **) |
| 29449 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.UPtrs2; |
| 29450 | |
| 29451 | { |
| 29452 | int_T i1; |
| 29453 | const uint8_T *u2 = L4_MABX_B.Encoder_o1; |
| 29454 | for (i1=0; i1 < 24; i1++) { |
| 29455 | sfcnUPtrs[i1] = &u2[i1]; |
| 29456 | } |
| 29457 | } |
| 29458 | |
| 29459 | ssSetInputPortSignalPtrs(rts, 2, (InputPtrsType)&sfcnUPtrs[0]); |
| 29460 | _ssSetInputPortNumDimensions(rts, 2, 1); |
| 29461 | ssSetInputPortWidth(rts, 2, 24); |
| 29462 | } |
| 29463 | } |
| 29464 | |
| 29465 | /* outputs */ |
| 29466 | { |
| 29467 | ssSetPortInfoForOutputs(rts, |
| 29468 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.outputPortInfo[0]); |
| 29469 | _ssSetNumOutputPorts(rts, 3); |
| 29470 | _ssSetPortInfo2ForOutputUnits(rts, |
| 29471 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.outputPortUnits[0]); |
| 29472 | ssSetOutputPortUnit(rts, 0, 0); |
| 29473 | ssSetOutputPortUnit(rts, 1, 0); |
| 29474 | ssSetOutputPortUnit(rts, 2, 0); |
| 29475 | _ssSetPortInfo2ForOutputCoSimAttribute(rts, |
| 29476 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.outputPortCoSimAttribute[0]); |
| 29477 | ssSetOutputPortIsContinuousQuantity(rts, 0, 0); |
| 29478 | ssSetOutputPortIsContinuousQuantity(rts, 1, 0); |
| 29479 | ssSetOutputPortIsContinuousQuantity(rts, 2, 0); |
| 29480 | |
| 29481 | /* port 0 */ |
| 29482 | { |
| 29483 | _ssSetOutputPortNumDimensions(rts, 0, 1); |
| 29484 | ssSetOutputPortWidth(rts, 0, 3); |
| 29485 | ssSetOutputPortSignal(rts, 0, ((uint32_T *) L4_MABX_B.TCPIP_Com_o1)); |
| 29486 | } |
| 29487 | |
| 29488 | /* port 1 */ |
| 29489 | { |
| 29490 | _ssSetOutputPortNumDimensions(rts, 1, 1); |
| 29491 | ssSetOutputPortWidth(rts, 1, 1); |
| 29492 | ssSetOutputPortSignal(rts, 1, ((uint32_T *) &L4_MABX_B.TCPIP_Com_o2)); |
| 29493 | } |
| 29494 | |
| 29495 | /* port 2 */ |
| 29496 | { |
| 29497 | _ssSetOutputPortNumDimensions(rts, 2, 1); |
| 29498 | ssSetOutputPortWidth(rts, 2, 128); |
| 29499 | ssSetOutputPortSignal(rts, 2, ((uint8_T *) L4_MABX_B.TCPIP_Com_o3)); |
| 29500 | } |
| 29501 | } |
| 29502 | |
| 29503 | /* path info */ |
| 29504 | ssSetModelName(rts, "TCPIP_Com"); |
| 29505 | ssSetPath(rts, "L4_MABX/ETHERNET/UDPIP_Communication/TCPIP_Com"); |
| 29506 | ssSetRTModel(rts,L4_MABX_M); |
| 29507 | ssSetParentSS(rts, (NULL)); |
| 29508 | ssSetRootSS(rts, rts); |
| 29509 | ssSetVersion(rts, SIMSTRUCT_VERSION_LEVEL2); |
| 29510 | |
| 29511 | /* parameters */ |
| 29512 | { |
| 29513 | mxArray **sfcnParams = (mxArray **) |
| 29514 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.params; |
| 29515 | ssSetSFcnParamsCount(rts, 6); |
| 29516 | ssSetSFcnParamsPtr(rts, &sfcnParams[0]); |
| 29517 | ssSetSFcnParam(rts, 0, (mxArray*)L4_MABX_P.TCPIP_Com_P1_Size); |
| 29518 | ssSetSFcnParam(rts, 1, (mxArray*)L4_MABX_P.TCPIP_Com_P2_Size); |
| 29519 | ssSetSFcnParam(rts, 2, (mxArray*)L4_MABX_P.TCPIP_Com_P3_Size); |
| 29520 | ssSetSFcnParam(rts, 3, (mxArray*)L4_MABX_P.TCPIP_Com_P4_Size); |
| 29521 | ssSetSFcnParam(rts, 4, (mxArray*)L4_MABX_P.TCPIP_Com_P5_Size); |
| 29522 | ssSetSFcnParam(rts, 5, (mxArray*)L4_MABX_P.TCPIP_Com_P6_Size); |
| 29523 | } |
| 29524 | |
| 29525 | /* work vectors */ |
| 29526 | ssSetPWork(rts, (void **) &L4_MABX_DW.TCPIP_Com_PWORK); |
| 29527 | |
| 29528 | { |
| 29529 | struct _ssDWorkRecord *dWorkRecord = (struct _ssDWorkRecord *) |
| 29530 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.dWork; |
| 29531 | struct _ssDWorkAuxRecord *dWorkAuxRecord = (struct _ssDWorkAuxRecord *) |
| 29532 | &L4_MABX_M->NonInlinedSFcns.Sfcn4.dWorkAux; |
| 29533 | ssSetSFcnDWork(rts, dWorkRecord); |
| 29534 | ssSetSFcnDWorkAux(rts, dWorkAuxRecord); |
| 29535 | _ssSetNumDWork(rts, 1); |
| 29536 | |
| 29537 | /* PWORK */ |
| 29538 | ssSetDWorkWidth(rts, 0, 1); |
| 29539 | ssSetDWorkDataType(rts, 0,SS_POINTER); |
| 29540 | ssSetDWorkComplexSignal(rts, 0, 0); |
| 29541 | ssSetDWork(rts, 0, &L4_MABX_DW.TCPIP_Com_PWORK); |
| 29542 | } |
| 29543 | |
| 29544 | /* registration */ |
| 29545 | dsa_tcpip_udp_sfcn(rts); |
| 29546 | sfcnInitializeSizes(rts); |
| 29547 | sfcnInitializeSampleTimes(rts); |
| 29548 | |
| 29549 | /* adjust sample time */ |
| 29550 | ssSetSampleTime(rts, 0, 0.01); |
| 29551 | ssSetOffsetTime(rts, 0, 0.0); |
| 29552 | sfcnTsMap[0] = 0; |
| 29553 | |
| 29554 | /* set compiled values of dynamic vector attributes */ |
| 29555 | ssSetNumNonsampledZCs(rts, 0); |
| 29556 | |
| 29557 | /* Update connectivity flags for each port */ |
| 29558 | _ssSetInputPortConnected(rts, 0, 1); |
| 29559 | _ssSetInputPortConnected(rts, 1, 1); |
| 29560 | _ssSetInputPortConnected(rts, 2, 1); |
| 29561 | _ssSetOutputPortConnected(rts, 0, 1); |
| 29562 | _ssSetOutputPortConnected(rts, 1, 1); |
| 29563 | _ssSetOutputPortConnected(rts, 2, 1); |
| 29564 | _ssSetOutputPortBeingMerged(rts, 0, 0); |
| 29565 | _ssSetOutputPortBeingMerged(rts, 1, 0); |
| 29566 | _ssSetOutputPortBeingMerged(rts, 2, 0); |
| 29567 | |
| 29568 | /* Update the BufferDstPort flags for each input port */ |
| 29569 | ssSetInputPortBufferDstPort(rts, 0, -1); |
| 29570 | ssSetInputPortBufferDstPort(rts, 1, -1); |
| 29571 | ssSetInputPortBufferDstPort(rts, 2, -1); |
| 29572 | } |
| 29573 | } |
| 29574 | |
| 29575 | { |
| 29576 | /* user code (registration function declaration) */ |
| 29577 | /*Initialize global TRC pointers. */ |
| 29578 | L4_MABX_rti_init_trc_pointers(); |
| 29579 | } |
| 29580 | |
| 29581 | /* Start for Enabled SubSystem: '<S744>/Slew_at_event' */ |
| 29582 | L4_MABX_DW.Slew_at_event_MODE = false; |
| 29583 | |
| 29584 | /* End of Start for SubSystem: '<S744>/Slew_at_event' */ |
| 29585 | |
| 29586 | /* Start for S-Function (dsa_tcpip_setup_sfcn): '<S399>/dsa_tcpip_setup' */ |
| 29587 | /* Level2 S-Function Block: '<S399>/dsa_tcpip_setup' (dsa_tcpip_setup_sfcn) */ |
| 29588 | { |
| 29589 | SimStruct *rts = L4_MABX_M->childSfunctions[3]; |
| 29590 | sfcnStart(rts); |
| 29591 | if (ssGetErrorStatus(rts) != (NULL)) |
| 29592 | return; |
| 29593 | } |
| 29594 | |
| 29595 | /* Start for Constant: '<S3>/Enable' */ |
| 29596 | L4_MABX_B.Enable = L4_MABX_P.Enable_Value; |
| 29597 | |
| 29598 | /* Start for S-Function (dsa_gen_tx_RTMapsEncode_sfun): '<S407>/Encoder' */ |
| 29599 | Init_Tx_RTMapsEncode(); |
| 29600 | |
| 29601 | /* Start for S-Function (dsa_tcpip_udp_sfcn): '<S400>/TCPIP_Com' */ |
| 29602 | /* Level2 S-Function Block: '<S400>/TCPIP_Com' (dsa_tcpip_udp_sfcn) */ |
| 29603 | { |
| 29604 | SimStruct *rts = L4_MABX_M->childSfunctions[4]; |
| 29605 | sfcnStart(rts); |
| 29606 | if (ssGetErrorStatus(rts) != (NULL)) |
| 29607 | return; |
| 29608 | } |
| 29609 | |
| 29610 | /* Start for S-Function (dsa_gen_rx_RTMapsDecode_sfun): '<S404>/Decoder' */ |
| 29611 | Init_Rx_RTMapsDecode(); |
| 29612 | |
| 29613 | /* Start for Atomic SubSystem: '<S65>/Task_10ms' */ |
| 29614 | /* Start for RateTransition: '<S81>/TmpRTBAtSignal Conversion1Inport1' */ |
| 29615 | L4_MABX_B.distanceSpdTarget_e = L4_MABX_P.TmpRTBAtSignalConversion1Inport; |
| 29616 | |
| 29617 | /* Start for Enabled SubSystem: '<S79>/Throttle_controller_gov' */ |
| 29618 | L4_MABX_DW.Throttle_controller_gov_MODE = false; |
| 29619 | |
| 29620 | /* Start for Enabled SubSystem: '<S244>/Calculate_D_term' */ |
| 29621 | L4_M_Calculate_D_term_Start(&L4_MABX_DW.Calculate_D_term_h); |
| 29622 | |
| 29623 | /* End of Start for SubSystem: '<S244>/Calculate_D_term' */ |
| 29624 | |
| 29625 | /* Start for Enabled SubSystem: '<S244>/Calculate_I_term' */ |
| 29626 | L4_M_Calculate_I_term_Start(&L4_MABX_DW.Calculate_I_term_n); |
| 29627 | |
| 29628 | /* End of Start for SubSystem: '<S244>/Calculate_I_term' */ |
| 29629 | |
| 29630 | /* End of Start for SubSystem: '<S79>/Throttle_controller_gov' */ |
| 29631 | |
| 29632 | /* Start for Enabled SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */ |
| 29633 | L4_MABX_DW.Determine_shift_interlock_brake = false; |
| 29634 | |
| 29635 | /* End of Start for SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */ |
| 29636 | |
| 29637 | /* Start for Enabled SubSystem: '<S105>/Determine_brake_hold_pressure_target' */ |
| 29638 | L4_MABX_DW.Determine_brake_hold_pressure_t = false; |
| 29639 | |
| 29640 | /* End of Start for SubSystem: '<S105>/Determine_brake_hold_pressure_target' */ |
| 29641 | |
| 29642 | /* Start for Enabled SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */ |
| 29643 | L4_MABX_DW.Bendix_2C2_brake_application_pr = false; |
| 29644 | |
| 29645 | /* Start for Enabled SubSystem: '<S112>/Calculate_D_term' */ |
| 29646 | L4_M_Calculate_D_term_Start(&L4_MABX_DW.Calculate_D_term); |
| 29647 | |
| 29648 | /* End of Start for SubSystem: '<S112>/Calculate_D_term' */ |
| 29649 | |
| 29650 | /* Start for Enabled SubSystem: '<S112>/Calculate_I_term' */ |
| 29651 | L4_M_Calculate_I_term_Start(&L4_MABX_DW.Calculate_I_term); |
| 29652 | |
| 29653 | /* End of Start for SubSystem: '<S112>/Calculate_I_term' */ |
| 29654 | |
| 29655 | /* End of Start for SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */ |
| 29656 | |
| 29657 | /* Start for RateTransition: '<S81>/TmpRTBAtSignal Conversion3Inport1' */ |
| 29658 | L4_MABX_B.pathSpdLimit_a = L4_MABX_P.TmpRTBAtSignalConversion3Inport; |
| 29659 | |
| 29660 | /* Start for RateTransition: '<S81>/TmpRTBAtSignal Conversion2Inport1' */ |
| 29661 | L4_MABX_B.distance_o = L4_MABX_P.TmpRTBAtSignalConversion2Inport; |
| 29662 | |
| 29663 | /* Start for Enabled SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */ |
| 29664 | L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba = false; |
| 29665 | |
| 29666 | /* Start for Enabled SubSystem: '<S150>/Calculate_D_term' */ |
| 29667 | L4_M_Calculate_D_term_Start(&L4_MABX_DW.Calculate_D_term_p); |
| 29668 | |
| 29669 | /* End of Start for SubSystem: '<S150>/Calculate_D_term' */ |
| 29670 | |
| 29671 | /* Start for Enabled SubSystem: '<S150>/Calculate_I_term' */ |
| 29672 | L4_M_Calculate_I_term_Start(&L4_MABX_DW.Calculate_I_term_e); |
| 29673 | |
| 29674 | /* End of Start for SubSystem: '<S150>/Calculate_I_term' */ |
| 29675 | |
| 29676 | /* End of Start for SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */ |
| 29677 | |
| 29678 | /* Start for Enabled SubSystem: '<S79>/Engine_speed_target' */ |
| 29679 | L4_MABX_DW.Engine_speed_target_MODE = false; |
| 29680 | |
| 29681 | /* End of Start for SubSystem: '<S79>/Engine_speed_target' */ |
| 29682 | |
| 29683 | /* Start for Enabled SubSystem: '<S283>/Slew_at_event' */ |
| 29684 | L4_MABX_DW.Slew_at_event_MODE_d = false; |
| 29685 | |
| 29686 | /* End of Start for SubSystem: '<S283>/Slew_at_event' */ |
| 29687 | |
| 29688 | /* Start for RateTransition: '<S80>/TmpRTBAtrad2deg1Inport1' */ |
| 29689 | L4_MABX_B.previewSteeringAngle_b = L4_MABX_P.TmpRTBAtrad2deg1Inport1_Initial; |
| 29690 | |
| 29691 | /* Start for RateTransition: '<S80>/TmpRTBAtsignCurveOffsetInport1' */ |
| 29692 | L4_MABX_B.TmpRTBAtsignCurveOffsetInport1 = |
| 29693 | L4_MABX_P.TmpRTBAtsignCurveOffsetInport1_; |
| 29694 | |
| 29695 | /* Start for RateTransition: '<S284>/TmpRTBAtAdd2Inport2' */ |
| 29696 | L4_MABX_B.TmpRTBAtAdd2Inport2 = L4_MABX_P.TmpRTBAtAdd2Inport2_InitialCond; |
| 29697 | |
| 29698 | /* End of Start for SubSystem: '<S65>/Task_10ms' */ |
| 29699 | |
| 29700 | /* Start for Atomic SubSystem: '<S849>/CAN_TX_10ms' */ |
| 29701 | |
| 29702 | /* Start for Width: '<S1006>/Width' */ |
| 29703 | L4_MABX_B.Width_l = 16U; |
| 29704 | |
| 29705 | /* End of Start for SubSystem: '<S849>/CAN_TX_10ms' */ |
| 29706 | |
| 29707 | /* Start for Atomic SubSystem: '<S849>/CAN_TX_20ms' */ |
| 29708 | |
| 29709 | /* Start for Width: '<S1034>/Width' */ |
| 29710 | L4_MABX_B.Width_e = 16U; |
| 29711 | |
| 29712 | /* End of Start for SubSystem: '<S849>/CAN_TX_20ms' */ |
| 29713 | |
| 29714 | /* Start for Atomic SubSystem: '<S849>/CAN_TX_5000ms' */ |
| 29715 | |
| 29716 | /* Start for Width: '<S1049>/Width' */ |
| 29717 | L4_MABX_B.Width = 8U; |
| 29718 | |
| 29719 | /* End of Start for SubSystem: '<S849>/CAN_TX_5000ms' */ |
| 29720 | |
| 29721 | /* Start for RateTransition: '<S1078>/TmpRTBAtANDInport1' */ |
| 29722 | L4_MABX_B.TmpRTBAtANDInport1 = L4_MABX_P.TmpRTBAtANDInport1_InitialCondi; |
| 29723 | |
| 29724 | /* Start for Atomic SubSystem: '<S65>/Task_20ms' */ |
| 29725 | /* Start for Constant: '<S396>/InitialHeading' */ |
| 29726 | L4_MABX_B.InitialHeading = L4_MABX_P.InitialHeading_Value; |
| 29727 | |
| 29728 | /* Start for Constant: '<S396>/InitialPosition' */ |
| 29729 | L4_MABX_B.InitialPosition = L4_MABX_P.InitialPosition_Value; |
| 29730 | |
| 29731 | /* Start for Constant: '<S396>/InitialXPosition' */ |
| 29732 | L4_MABX_B.InitialXPosition = L4_MABX_P.InitialXPosition_Value; |
| 29733 | |
| 29734 | /* Start for Constant: '<S396>/InitialYPosition' */ |
| 29735 | L4_MABX_B.InitialYPosition = L4_MABX_P.InitialYPosition_Value; |
| 29736 | |
| 29737 | /* End of Start for SubSystem: '<S65>/Task_20ms' */ |
| 29738 | |
| 29739 | /* Start for S-Function (rti_commonblock): '<S408>/S-Function1' incorporates: |
| 29740 | * SubSystem: '<S399>/Background_Task' |
| 29741 | */ |
| 29742 | L4_MA_Background_Task_Start(); |
| 29743 | |
| 29744 | /* End of Start for S-Function (rti_commonblock): '<S408>/S-Function1' */ |
| 29745 | |
| 29746 | /* Start for S-Function (rti_commonblock): '<S414>/S-Function1' incorporates: |
| 29747 | * SubSystem: '<S399>/Interrupt_Task' |
| 29748 | */ |
| 29749 | L4_MAB_Interrupt_Task_Start(); |
| 29750 | |
| 29751 | /* End of Start for S-Function (rti_commonblock): '<S414>/S-Function1' */ |
| 29752 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C1_Trig_ZCE = UNINITIALIZED_ZCSIG; |
| 29753 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C2_Trig_ZCE = UNINITIALIZED_ZCSIG; |
| 29754 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C1_Trig_ZCE = UNINITIALIZED_ZCSIG; |
| 29755 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C2_Trig_ZCE = UNINITIALIZED_ZCSIG; |
| 29756 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C1_Trig_ZCE = UNINITIALIZED_ZCSIG; |
| 29757 | L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C2_Trig_ZCE = UNINITIALIZED_ZCSIG; |
| 29758 | L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE_m = POS_ZCSIG; |
| 29759 | L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE = POS_ZCSIG; |
| 29760 | |
| 29761 | { |
| 29762 | int32_T i; |
| 29763 | |
| 29764 | /* InitializeConditions for UnitDelay: '<S757>/Unit Delay' */ |
| 29765 | L4_MABX_DW.UnitDelay_DSTATE = L4_MABX_P.UnitDelay_InitialCondition_f; |
| 29766 | |
| 29767 | /* InitializeConditions for UnitDelay: '<S755>/Delay Input1' */ |
| 29768 | L4_MABX_DW.DelayInput1_DSTATE_g = L4_MABX_P.DetectRisePositive_vinit; |
| 29769 | |
| 29770 | /* InitializeConditions for UnitDelay: '<S756>/Unit Delay' */ |
| 29771 | L4_MABX_DW.UnitDelay_DSTATE_i = L4_MABX_P.UnitDelay_InitialCondition_e; |
| 29772 | |
| 29773 | /* InitializeConditions for UnitDelay: '<S743>/Unit Delay' */ |
| 29774 | L4_MABX_DW.UnitDelay_DSTATE_ms = L4_MABX_P.UnitDelay_InitialCondition_k; |
| 29775 | |
| 29776 | /* InitializeConditions for UnitDelay: '<S754>/Delay Input1' */ |
| 29777 | L4_MABX_DW.DelayInput1_DSTATE_m = L4_MABX_P.DetectFallNonpositive_vinit_a; |
| 29778 | |
| 29779 | /* InitializeConditions for UnitDelay: '<S756>/Unit Delay1' */ |
| 29780 | L4_MABX_DW.UnitDelay1_DSTATE_bf = L4_MABX_P.UnitDelay1_InitialCondition_f; |
| 29781 | |
| 29782 | /* InitializeConditions for UnitDelay: '<S757>/Unit Delay1' */ |
| 29783 | L4_MABX_DW.UnitDelay1_DSTATE_e = L4_MABX_P.UnitDelay1_InitialCondition_c; |
| 29784 | |
| 29785 | /* InitializeConditions for UnitDelay: '<S796>/FixPt Unit Delay2' */ |
| 29786 | L4_MABX_DW.FixPtUnitDelay2_DSTATE = |
| 29787 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_k; |
| 29788 | |
| 29789 | /* InitializeConditions for UnitDelay: '<S796>/FixPt Unit Delay1' */ |
| 29790 | L4_MABX_DW.FixPtUnitDelay1_DSTATE = |
| 29791 | L4_MABX_P.FixPtUnitDelay1_InitialCondi_bg; |
| 29792 | |
| 29793 | /* InitializeConditions for UnitDelay: '<S788>/FixPt Unit Delay2' */ |
| 29794 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_k = |
| 29795 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_d; |
| 29796 | |
| 29797 | /* InitializeConditions for UnitDelay: '<S788>/FixPt Unit Delay1' */ |
| 29798 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_p = |
| 29799 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_g; |
| 29800 | |
| 29801 | /* InitializeConditions for UnitDelay: '<S812>/FixPt Unit Delay2' */ |
| 29802 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_e = |
| 29803 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_kx; |
| 29804 | |
| 29805 | /* InitializeConditions for UnitDelay: '<S812>/FixPt Unit Delay1' */ |
| 29806 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_p4 = |
| 29807 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_k; |
| 29808 | |
| 29809 | /* InitializeConditions for UnitDelay: '<S804>/FixPt Unit Delay2' */ |
| 29810 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_g = |
| 29811 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_ej; |
| 29812 | |
| 29813 | /* InitializeConditions for UnitDelay: '<S804>/FixPt Unit Delay1' */ |
| 29814 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_pb = |
| 29815 | L4_MABX_P.FixPtUnitDelay1_InitialCondi_fp; |
| 29816 | |
| 29817 | /* InitializeConditions for UnitDelay: '<S766>/Unit_Delay' */ |
| 29818 | L4_MABX_DW.Unit_Delay_DSTATE_mb = L4_MABX_P.Unit_Delay_InitialCondition_ah; |
| 29819 | |
| 29820 | /* InitializeConditions for UnitDelay: '<S833>/Unit_Delay1' */ |
| 29821 | L4_MABX_DW.Unit_Delay1_DSTATE = L4_MABX_P.Unit_Delay1_InitialCondition_b; |
| 29822 | |
| 29823 | /* InitializeConditions for UnitDelay: '<S833>/Unit_Delay2' */ |
| 29824 | L4_MABX_DW.Unit_Delay2_DSTATE = L4_MABX_P.Unit_Delay2_InitialCondition_d; |
| 29825 | |
| 29826 | /* InitializeConditions for UnitDelay: '<S766>/Unit_Delay1' */ |
| 29827 | L4_MABX_DW.Unit_Delay1_DSTATE_a = L4_MABX_P.Unit_Delay1_InitialCondition_l; |
| 29828 | |
| 29829 | /* InitializeConditions for UnitDelay: '<S834>/Unit_Delay1' */ |
| 29830 | L4_MABX_DW.Unit_Delay1_DSTATE_l = L4_MABX_P.Unit_Delay1_InitialCondition_i; |
| 29831 | |
| 29832 | /* InitializeConditions for UnitDelay: '<S834>/Unit_Delay2' */ |
| 29833 | L4_MABX_DW.Unit_Delay2_DSTATE_m = L4_MABX_P.Unit_Delay2_InitialCondition_n; |
| 29834 | |
| 29835 | /* InitializeConditions for UnitDelay: '<S832>/FixPt Unit Delay2' */ |
| 29836 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_o = |
| 29837 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_cl; |
| 29838 | |
| 29839 | /* InitializeConditions for UnitDelay: '<S832>/FixPt Unit Delay1' */ |
| 29840 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g = |
| 29841 | L4_MABX_P.FixPtUnitDelay1_InitialCondi_gw; |
| 29842 | |
| 29843 | /* InitializeConditions for UnitDelay: '<S831>/FixPt Unit Delay2' */ |
| 29844 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_h = |
| 29845 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_gz; |
| 29846 | |
| 29847 | /* InitializeConditions for UnitDelay: '<S831>/FixPt Unit Delay1' */ |
| 29848 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_p2 = |
| 29849 | L4_MABX_P.FixPtUnitDelay1_InitialCondi_b4; |
| 29850 | |
| 29851 | /* InitializeConditions for UnitDelay: '<S820>/FixPt Unit Delay2' */ |
| 29852 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_eo = |
| 29853 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_o; |
| 29854 | |
| 29855 | /* InitializeConditions for UnitDelay: '<S820>/FixPt Unit Delay1' */ |
| 29856 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_h = |
| 29857 | L4_MABX_P.FixPtUnitDelay1_InitialCondi_ju; |
| 29858 | |
| 29859 | /* InitializeConditions for RateTransition: '<S417>/Rate Transition' */ |
| 29860 | L4_MABX_DW.RateTransition_Buffer0 = |
| 29861 | L4_MABX_P.RateTransition_InitialCondition; |
| 29862 | L4_MABX_DW.RateTransition_write_buf = -1; |
| 29863 | L4_MABX_DW.RateTransition_read_buf = -1; |
| 29864 | |
| 29865 | /* InitializeConditions for UnitDelay: '<S649>/Unit_Delay3' */ |
| 29866 | L4_MABX_DW.Unit_Delay3_DSTATE = L4_MABX_P.Unit_Delay3_InitialCondition; |
| 29867 | |
| 29868 | /* InitializeConditions for UnitDelay: '<S649>/Unit_Delay' */ |
| 29869 | L4_MABX_DW.Unit_Delay_DSTATE_i5 = L4_MABX_P.Unit_Delay_InitialCondition_hh; |
| 29870 | |
| 29871 | /* InitializeConditions for UnitDelay: '<S655>/Unit_Delay' */ |
| 29872 | L4_MABX_DW.Unit_Delay_DSTATE_eo = L4_MABX_P.Unit_Delay_InitialCondition_fr; |
| 29873 | |
| 29874 | /* InitializeConditions for S-Function (dsa_tcpip_setup_sfcn): '<S399>/dsa_tcpip_setup' */ |
| 29875 | /* Level2 S-Function Block: '<S399>/dsa_tcpip_setup' (dsa_tcpip_setup_sfcn) */ |
| 29876 | { |
| 29877 | SimStruct *rts = L4_MABX_M->childSfunctions[3]; |
| 29878 | sfcnInitializeConditions(rts); |
| 29879 | if (ssGetErrorStatus(rts) != (NULL)) |
| 29880 | return; |
| 29881 | } |
| 29882 | |
| 29883 | /* InitializeConditions for DiscretePulseGenerator: '<S398>/Heartbeat' */ |
| 29884 | L4_MABX_DW.clockTickCounter = 0; |
| 29885 | |
| 29886 | /* InitializeConditions for UnitDelay: '<S3>/Unit_Delay' */ |
| 29887 | L4_MABX_DW.Unit_Delay_80_DSTATE = L4_MABX_P.Unit_Delay_80_InitialCondition; |
| 29888 | L4_MABX_DW.Unit_Delay_81_DSTATE = L4_MABX_P.Unit_Delay_81_InitialCondition; |
| 29889 | L4_MABX_DW.Unit_Delay_48_DSTATE = L4_MABX_P.Unit_Delay_48_InitialCondition; |
| 29890 | L4_MABX_DW.Unit_Delay_83_DSTATE = L4_MABX_P.Unit_Delay_83_InitialCondition; |
| 29891 | L4_MABX_DW.Unit_Delay_45_DSTATE = L4_MABX_P.Unit_Delay_45_InitialCondition; |
| 29892 | L4_MABX_DW.Unit_Delay_47_DSTATE = L4_MABX_P.Unit_Delay_47_InitialCondition; |
| 29893 | L4_MABX_DW.Unit_Delay_84_DSTATE = L4_MABX_P.Unit_Delay_84_InitialCondition; |
| 29894 | |
| 29895 | /* InitializeConditions for S-Function (dsa_tcpip_udp_sfcn): '<S400>/TCPIP_Com' */ |
| 29896 | /* Level2 S-Function Block: '<S400>/TCPIP_Com' (dsa_tcpip_udp_sfcn) */ |
| 29897 | { |
| 29898 | SimStruct *rts = L4_MABX_M->childSfunctions[4]; |
| 29899 | sfcnInitializeConditions(rts); |
| 29900 | if (ssGetErrorStatus(rts) != (NULL)) |
| 29901 | return; |
| 29902 | } |
| 29903 | |
| 29904 | /* InitializeConditions for UnitDelay: '<S405>/Delay Input1' */ |
| 29905 | L4_MABX_DW.DelayInput1_DSTATE_n = L4_MABX_P.DetectRisePositive1_vinit; |
| 29906 | |
| 29907 | /* InitializeConditions for UnitDelay: '<S403>/Unit Delay' */ |
| 29908 | L4_MABX_DW.UnitDelay_DSTATE_k = L4_MABX_P.UnitDelay_InitialCondition_h; |
| 29909 | |
| 29910 | /* InitializeConditions for UnitDelay: '<S859>/Unit Delay2' */ |
| 29911 | L4_MABX_DW.UnitDelay2_DSTATE = L4_MABX_P.UnitDelay2_InitialCondition; |
| 29912 | |
| 29913 | /* InitializeConditions for UnitDelay: '<S859>/Unit Delay1' */ |
| 29914 | L4_MABX_DW.UnitDelay1_DSTATE_b = L4_MABX_P.UnitDelay1_InitialCondition_a; |
| 29915 | |
| 29916 | /* InitializeConditions for UnitDelay: '<S859>/Unit Delay3' */ |
| 29917 | L4_MABX_DW.UnitDelay3_DSTATE = L4_MABX_P.UnitDelay3_InitialCondition; |
| 29918 | |
| 29919 | /* InitializeConditions for RateTransition: '<S1078>/TmpRTBAtANDInport1' */ |
| 29920 | L4_MABX_DW.TmpRTBAtANDInport1_Buffer0 = |
| 29921 | L4_MABX_P.TmpRTBAtANDInport1_InitialCondi; |
| 29922 | |
| 29923 | /* InitializeConditions for DiscretePulseGenerator: '<S1078>/Flash' */ |
| 29924 | L4_MABX_DW.clockTickCounter_d = 0; |
| 29925 | |
| 29926 | /* InitializeConditions for UnitDelay: '<S3>/Unit_Delay' */ |
| 29927 | L4_MABX_DW.Unit_Delay_1_DSTATE = L4_MABX_P.Unit_Delay_1_InitialCondition_f; |
| 29928 | L4_MABX_DW.Unit_Delay_10_DSTATE = L4_MABX_P.Unit_Delay_10_InitialCondition; |
| 29929 | L4_MABX_DW.Unit_Delay_100_DSTATE = L4_MABX_P.Unit_Delay_100_InitialCondition; |
| 29930 | L4_MABX_DW.Unit_Delay_101_DSTATE = L4_MABX_P.Unit_Delay_101_InitialCondition; |
| 29931 | L4_MABX_DW.Unit_Delay_102_DSTATE = L4_MABX_P.Unit_Delay_102_InitialCondition; |
| 29932 | L4_MABX_DW.Unit_Delay_103_DSTATE = L4_MABX_P.Unit_Delay_103_InitialCondition; |
| 29933 | L4_MABX_DW.Unit_Delay_104_DSTATE = L4_MABX_P.Unit_Delay_104_InitialCondition; |
| 29934 | L4_MABX_DW.Unit_Delay_105_DSTATE = L4_MABX_P.Unit_Delay_105_InitialCondition; |
| 29935 | L4_MABX_DW.Unit_Delay_106_DSTATE = L4_MABX_P.Unit_Delay_106_InitialCondition; |
| 29936 | L4_MABX_DW.Unit_Delay_107_DSTATE = L4_MABX_P.Unit_Delay_107_InitialCondition; |
| 29937 | L4_MABX_DW.Unit_Delay_108_DSTATE = L4_MABX_P.Unit_Delay_108_InitialCondition; |
| 29938 | L4_MABX_DW.Unit_Delay_109_DSTATE = L4_MABX_P.Unit_Delay_109_InitialCondition; |
| 29939 | L4_MABX_DW.Unit_Delay_11_DSTATE = L4_MABX_P.Unit_Delay_11_InitialCondition; |
| 29940 | L4_MABX_DW.Unit_Delay_110_DSTATE = L4_MABX_P.Unit_Delay_110_InitialCondition; |
| 29941 | L4_MABX_DW.Unit_Delay_111_DSTATE = L4_MABX_P.Unit_Delay_111_InitialCondition; |
| 29942 | L4_MABX_DW.Unit_Delay_112_DSTATE = L4_MABX_P.Unit_Delay_112_InitialCondition; |
| 29943 | L4_MABX_DW.Unit_Delay_113_DSTATE = L4_MABX_P.Unit_Delay_113_InitialCondition; |
| 29944 | L4_MABX_DW.Unit_Delay_114_DSTATE = L4_MABX_P.Unit_Delay_114_InitialCondition; |
| 29945 | L4_MABX_DW.Unit_Delay_115_DSTATE = L4_MABX_P.Unit_Delay_115_InitialCondition; |
| 29946 | L4_MABX_DW.Unit_Delay_116_DSTATE = L4_MABX_P.Unit_Delay_116_InitialCondition; |
| 29947 | L4_MABX_DW.Unit_Delay_117_DSTATE = L4_MABX_P.Unit_Delay_117_InitialCondition; |
| 29948 | L4_MABX_DW.Unit_Delay_118_DSTATE = L4_MABX_P.Unit_Delay_118_InitialCondition; |
| 29949 | L4_MABX_DW.Unit_Delay_119_DSTATE = L4_MABX_P.Unit_Delay_119_InitialCondition; |
| 29950 | L4_MABX_DW.Unit_Delay_12_DSTATE = L4_MABX_P.Unit_Delay_12_InitialCondition; |
| 29951 | L4_MABX_DW.Unit_Delay_120_DSTATE = L4_MABX_P.Unit_Delay_120_InitialCondition; |
| 29952 | L4_MABX_DW.Unit_Delay_121_DSTATE = L4_MABX_P.Unit_Delay_121_InitialCondition; |
| 29953 | L4_MABX_DW.Unit_Delay_122_DSTATE = L4_MABX_P.Unit_Delay_122_InitialCondition; |
| 29954 | L4_MABX_DW.Unit_Delay_123_DSTATE = L4_MABX_P.Unit_Delay_123_InitialCondition; |
| 29955 | L4_MABX_DW.Unit_Delay_124_DSTATE = L4_MABX_P.Unit_Delay_124_InitialCondition; |
| 29956 | L4_MABX_DW.Unit_Delay_125_DSTATE = L4_MABX_P.Unit_Delay_125_InitialCondition; |
| 29957 | L4_MABX_DW.Unit_Delay_126_DSTATE = L4_MABX_P.Unit_Delay_126_InitialCondition; |
| 29958 | L4_MABX_DW.Unit_Delay_127_DSTATE = L4_MABX_P.Unit_Delay_127_InitialCondition; |
| 29959 | L4_MABX_DW.Unit_Delay_128_DSTATE = L4_MABX_P.Unit_Delay_128_InitialCondition; |
| 29960 | L4_MABX_DW.Unit_Delay_129_DSTATE = L4_MABX_P.Unit_Delay_129_InitialCondition; |
| 29961 | L4_MABX_DW.Unit_Delay_13_DSTATE = L4_MABX_P.Unit_Delay_13_InitialCondition; |
| 29962 | L4_MABX_DW.Unit_Delay_130_DSTATE = L4_MABX_P.Unit_Delay_130_InitialCondition; |
| 29963 | L4_MABX_DW.Unit_Delay_131_DSTATE = L4_MABX_P.Unit_Delay_131_InitialCondition; |
| 29964 | L4_MABX_DW.Unit_Delay_132_DSTATE = L4_MABX_P.Unit_Delay_132_InitialCondition; |
| 29965 | L4_MABX_DW.Unit_Delay_133_DSTATE = L4_MABX_P.Unit_Delay_133_InitialCondition; |
| 29966 | L4_MABX_DW.Unit_Delay_134_DSTATE = L4_MABX_P.Unit_Delay_134_InitialCondition; |
| 29967 | L4_MABX_DW.Unit_Delay_135_DSTATE = L4_MABX_P.Unit_Delay_135_InitialCondition; |
| 29968 | L4_MABX_DW.Unit_Delay_136_DSTATE = L4_MABX_P.Unit_Delay_136_InitialCondition; |
| 29969 | L4_MABX_DW.Unit_Delay_137_DSTATE = L4_MABX_P.Unit_Delay_137_InitialCondition; |
| 29970 | L4_MABX_DW.Unit_Delay_138_DSTATE = L4_MABX_P.Unit_Delay_138_InitialCondition; |
| 29971 | L4_MABX_DW.Unit_Delay_139_DSTATE = L4_MABX_P.Unit_Delay_139_InitialCondition; |
| 29972 | L4_MABX_DW.Unit_Delay_14_DSTATE = L4_MABX_P.Unit_Delay_14_InitialCondition; |
| 29973 | L4_MABX_DW.Unit_Delay_140_DSTATE = L4_MABX_P.Unit_Delay_140_InitialCondition; |
| 29974 | L4_MABX_DW.Unit_Delay_141_DSTATE = L4_MABX_P.Unit_Delay_141_InitialCondition; |
| 29975 | L4_MABX_DW.Unit_Delay_142_DSTATE = L4_MABX_P.Unit_Delay_142_InitialCondition; |
| 29976 | L4_MABX_DW.Unit_Delay_143_DSTATE = L4_MABX_P.Unit_Delay_143_InitialCondition; |
| 29977 | L4_MABX_DW.Unit_Delay_144_DSTATE = L4_MABX_P.Unit_Delay_144_InitialCondition; |
| 29978 | L4_MABX_DW.Unit_Delay_15_DSTATE = L4_MABX_P.Unit_Delay_15_InitialCondition; |
| 29979 | L4_MABX_DW.Unit_Delay_16_DSTATE = L4_MABX_P.Unit_Delay_16_InitialCondition; |
| 29980 | L4_MABX_DW.Unit_Delay_17_DSTATE = L4_MABX_P.Unit_Delay_17_InitialCondition; |
| 29981 | L4_MABX_DW.Unit_Delay_18_DSTATE = L4_MABX_P.Unit_Delay_18_InitialCondition; |
| 29982 | L4_MABX_DW.Unit_Delay_19_DSTATE = L4_MABX_P.Unit_Delay_19_InitialCondition; |
| 29983 | L4_MABX_DW.Unit_Delay_2_DSTATE = L4_MABX_P.Unit_Delay_2_InitialCondition_f; |
| 29984 | L4_MABX_DW.Unit_Delay_20_DSTATE = L4_MABX_P.Unit_Delay_20_InitialCondition; |
| 29985 | L4_MABX_DW.Unit_Delay_21_DSTATE = L4_MABX_P.Unit_Delay_21_InitialCondition; |
| 29986 | L4_MABX_DW.Unit_Delay_22_DSTATE = L4_MABX_P.Unit_Delay_22_InitialCondition; |
| 29987 | L4_MABX_DW.Unit_Delay_23_DSTATE = L4_MABX_P.Unit_Delay_23_InitialCondition; |
| 29988 | L4_MABX_DW.Unit_Delay_24_DSTATE = L4_MABX_P.Unit_Delay_24_InitialCondition; |
| 29989 | L4_MABX_DW.Unit_Delay_25_DSTATE = L4_MABX_P.Unit_Delay_25_InitialCondition; |
| 29990 | L4_MABX_DW.Unit_Delay_26_DSTATE = L4_MABX_P.Unit_Delay_26_InitialCondition; |
| 29991 | L4_MABX_DW.Unit_Delay_27_DSTATE = L4_MABX_P.Unit_Delay_27_InitialCondition; |
| 29992 | L4_MABX_DW.Unit_Delay_28_DSTATE = L4_MABX_P.Unit_Delay_28_InitialCondition; |
| 29993 | L4_MABX_DW.Unit_Delay_29_DSTATE = L4_MABX_P.Unit_Delay_29_InitialCondition; |
| 29994 | L4_MABX_DW.Unit_Delay_3_DSTATE = L4_MABX_P.Unit_Delay_3_InitialCondition_f; |
| 29995 | L4_MABX_DW.Unit_Delay_30_DSTATE = L4_MABX_P.Unit_Delay_30_InitialCondition; |
| 29996 | L4_MABX_DW.Unit_Delay_31_DSTATE = L4_MABX_P.Unit_Delay_31_InitialCondition; |
| 29997 | L4_MABX_DW.Unit_Delay_32_DSTATE = L4_MABX_P.Unit_Delay_32_InitialCondition; |
| 29998 | L4_MABX_DW.Unit_Delay_33_DSTATE = L4_MABX_P.Unit_Delay_33_InitialCondition; |
| 29999 | L4_MABX_DW.Unit_Delay_34_DSTATE = L4_MABX_P.Unit_Delay_34_InitialCondition; |
| 30000 | L4_MABX_DW.Unit_Delay_35_DSTATE = L4_MABX_P.Unit_Delay_35_InitialCondition; |
| 30001 | L4_MABX_DW.Unit_Delay_36_DSTATE = L4_MABX_P.Unit_Delay_36_InitialCondition; |
| 30002 | L4_MABX_DW.Unit_Delay_37_DSTATE = L4_MABX_P.Unit_Delay_37_InitialCondition; |
| 30003 | L4_MABX_DW.Unit_Delay_38_DSTATE = L4_MABX_P.Unit_Delay_38_InitialCondition; |
| 30004 | L4_MABX_DW.Unit_Delay_39_DSTATE = L4_MABX_P.Unit_Delay_39_InitialCondition; |
| 30005 | L4_MABX_DW.Unit_Delay_4_DSTATE = L4_MABX_P.Unit_Delay_4_InitialCondition; |
| 30006 | L4_MABX_DW.Unit_Delay_40_DSTATE = L4_MABX_P.Unit_Delay_40_InitialCondition; |
| 30007 | L4_MABX_DW.Unit_Delay_41_DSTATE = L4_MABX_P.Unit_Delay_41_InitialCondition; |
| 30008 | L4_MABX_DW.Unit_Delay_42_DSTATE = L4_MABX_P.Unit_Delay_42_InitialCondition; |
| 30009 | L4_MABX_DW.Unit_Delay_43_DSTATE = L4_MABX_P.Unit_Delay_43_InitialCondition; |
| 30010 | L4_MABX_DW.Unit_Delay_44_DSTATE = L4_MABX_P.Unit_Delay_44_InitialCondition; |
| 30011 | L4_MABX_DW.Unit_Delay_46_DSTATE = L4_MABX_P.Unit_Delay_46_InitialCondition; |
| 30012 | L4_MABX_DW.Unit_Delay_49_DSTATE = L4_MABX_P.Unit_Delay_49_InitialCondition; |
| 30013 | L4_MABX_DW.Unit_Delay_5_DSTATE = L4_MABX_P.Unit_Delay_5_InitialCondition; |
| 30014 | L4_MABX_DW.Unit_Delay_50_DSTATE = L4_MABX_P.Unit_Delay_50_InitialCondition; |
| 30015 | L4_MABX_DW.Unit_Delay_51_DSTATE = L4_MABX_P.Unit_Delay_51_InitialCondition; |
| 30016 | L4_MABX_DW.Unit_Delay_52_DSTATE = L4_MABX_P.Unit_Delay_52_InitialCondition; |
| 30017 | L4_MABX_DW.Unit_Delay_53_DSTATE = L4_MABX_P.Unit_Delay_53_InitialCondition; |
| 30018 | L4_MABX_DW.Unit_Delay_54_DSTATE = L4_MABX_P.Unit_Delay_54_InitialCondition; |
| 30019 | L4_MABX_DW.Unit_Delay_55_DSTATE = L4_MABX_P.Unit_Delay_55_InitialCondition; |
| 30020 | L4_MABX_DW.Unit_Delay_56_DSTATE = L4_MABX_P.Unit_Delay_56_InitialCondition; |
| 30021 | L4_MABX_DW.Unit_Delay_57_DSTATE = L4_MABX_P.Unit_Delay_57_InitialCondition; |
| 30022 | L4_MABX_DW.Unit_Delay_58_DSTATE = L4_MABX_P.Unit_Delay_58_InitialCondition; |
| 30023 | L4_MABX_DW.Unit_Delay_59_DSTATE = L4_MABX_P.Unit_Delay_59_InitialCondition; |
| 30024 | L4_MABX_DW.Unit_Delay_6_DSTATE = L4_MABX_P.Unit_Delay_6_InitialCondition; |
| 30025 | L4_MABX_DW.Unit_Delay_60_DSTATE = L4_MABX_P.Unit_Delay_60_InitialCondition; |
| 30026 | L4_MABX_DW.Unit_Delay_61_DSTATE = L4_MABX_P.Unit_Delay_61_InitialCondition; |
| 30027 | L4_MABX_DW.Unit_Delay_62_DSTATE = L4_MABX_P.Unit_Delay_62_InitialCondition; |
| 30028 | L4_MABX_DW.Unit_Delay_63_DSTATE = L4_MABX_P.Unit_Delay_63_InitialCondition; |
| 30029 | L4_MABX_DW.Unit_Delay_64_DSTATE = L4_MABX_P.Unit_Delay_64_InitialCondition; |
| 30030 | L4_MABX_DW.Unit_Delay_65_DSTATE = L4_MABX_P.Unit_Delay_65_InitialCondition; |
| 30031 | L4_MABX_DW.Unit_Delay_66_DSTATE = L4_MABX_P.Unit_Delay_66_InitialCondition; |
| 30032 | L4_MABX_DW.Unit_Delay_67_DSTATE = L4_MABX_P.Unit_Delay_67_InitialCondition; |
| 30033 | L4_MABX_DW.Unit_Delay_68_DSTATE = L4_MABX_P.Unit_Delay_68_InitialCondition; |
| 30034 | L4_MABX_DW.Unit_Delay_69_DSTATE = L4_MABX_P.Unit_Delay_69_InitialCondition; |
| 30035 | L4_MABX_DW.Unit_Delay_7_DSTATE = L4_MABX_P.Unit_Delay_7_InitialCondition; |
| 30036 | L4_MABX_DW.Unit_Delay_70_DSTATE = L4_MABX_P.Unit_Delay_70_InitialCondition; |
| 30037 | L4_MABX_DW.Unit_Delay_71_DSTATE = L4_MABX_P.Unit_Delay_71_InitialCondition; |
| 30038 | L4_MABX_DW.Unit_Delay_72_DSTATE = L4_MABX_P.Unit_Delay_72_InitialCondition; |
| 30039 | L4_MABX_DW.Unit_Delay_73_DSTATE = L4_MABX_P.Unit_Delay_73_InitialCondition; |
| 30040 | L4_MABX_DW.Unit_Delay_74_DSTATE = L4_MABX_P.Unit_Delay_74_InitialCondition; |
| 30041 | L4_MABX_DW.Unit_Delay_75_DSTATE = L4_MABX_P.Unit_Delay_75_InitialCondition; |
| 30042 | L4_MABX_DW.Unit_Delay_76_DSTATE = L4_MABX_P.Unit_Delay_76_InitialCondition; |
| 30043 | L4_MABX_DW.Unit_Delay_77_DSTATE = L4_MABX_P.Unit_Delay_77_InitialCondition; |
| 30044 | L4_MABX_DW.Unit_Delay_78_DSTATE = L4_MABX_P.Unit_Delay_78_InitialCondition; |
| 30045 | L4_MABX_DW.Unit_Delay_79_DSTATE = L4_MABX_P.Unit_Delay_79_InitialCondition; |
| 30046 | L4_MABX_DW.Unit_Delay_8_DSTATE = L4_MABX_P.Unit_Delay_8_InitialCondition; |
| 30047 | L4_MABX_DW.Unit_Delay_82_DSTATE = L4_MABX_P.Unit_Delay_82_InitialCondition; |
| 30048 | L4_MABX_DW.Unit_Delay_85_DSTATE = L4_MABX_P.Unit_Delay_85_InitialCondition; |
| 30049 | L4_MABX_DW.Unit_Delay_86_DSTATE = L4_MABX_P.Unit_Delay_86_InitialCondition; |
| 30050 | L4_MABX_DW.Unit_Delay_87_DSTATE = L4_MABX_P.Unit_Delay_87_InitialCondition; |
| 30051 | L4_MABX_DW.Unit_Delay_88_DSTATE = L4_MABX_P.Unit_Delay_88_InitialCondition; |
| 30052 | L4_MABX_DW.Unit_Delay_89_DSTATE = L4_MABX_P.Unit_Delay_89_InitialCondition; |
| 30053 | L4_MABX_DW.Unit_Delay_9_DSTATE = L4_MABX_P.Unit_Delay_9_InitialCondition; |
| 30054 | L4_MABX_DW.Unit_Delay_90_DSTATE = L4_MABX_P.Unit_Delay_90_InitialCondition; |
| 30055 | L4_MABX_DW.Unit_Delay_91_DSTATE = L4_MABX_P.Unit_Delay_91_InitialCondition; |
| 30056 | L4_MABX_DW.Unit_Delay_92_DSTATE = L4_MABX_P.Unit_Delay_92_InitialCondition; |
| 30057 | L4_MABX_DW.Unit_Delay_93_DSTATE = L4_MABX_P.Unit_Delay_93_InitialCondition; |
| 30058 | L4_MABX_DW.Unit_Delay_94_DSTATE = L4_MABX_P.Unit_Delay_94_InitialCondition; |
| 30059 | L4_MABX_DW.Unit_Delay_95_DSTATE = L4_MABX_P.Unit_Delay_95_InitialCondition; |
| 30060 | L4_MABX_DW.Unit_Delay_96_DSTATE = L4_MABX_P.Unit_Delay_96_InitialCondition; |
| 30061 | L4_MABX_DW.Unit_Delay_97_DSTATE = L4_MABX_P.Unit_Delay_97_InitialCondition; |
| 30062 | L4_MABX_DW.Unit_Delay_98_DSTATE = L4_MABX_P.Unit_Delay_98_InitialCondition; |
| 30063 | L4_MABX_DW.Unit_Delay_99_DSTATE = L4_MABX_P.Unit_Delay_99_InitialCondition; |
| 30064 | |
| 30065 | /* InitializeConditions for UnitDelay: '<S649>/Unit_Delay2' */ |
| 30066 | L4_MABX_DW.Unit_Delay2_DSTATE_d0 = L4_MABX_P.Unit_Delay2_InitialCondition_d5; |
| 30067 | |
| 30068 | /* InitializeConditions for UnitDelay: '<S649>/Unit_Delay1' */ |
| 30069 | L4_MABX_DW.Unit_Delay1_DSTATE_d = L4_MABX_P.Unit_Delay1_InitialCondition_e; |
| 30070 | |
| 30071 | /* InitializeConditions for UnitDelay: '<S656>/Unit_Delay' */ |
| 30072 | L4_MABX_DW.Unit_Delay_DSTATE_n = L4_MABX_P.Unit_Delay_InitialCondition_fm; |
| 30073 | |
| 30074 | /* InitializeConditions for UnitDelay: '<S747>/Delay Input1' */ |
| 30075 | L4_MABX_DW.DelayInput1_DSTATE_b = L4_MABX_P.DetectRisePositive_vinit_b; |
| 30076 | |
| 30077 | /* InitializeConditions for UnitDelay: '<S748>/Unit Delay' */ |
| 30078 | L4_MABX_DW.UnitDelay_DSTATE_d = L4_MABX_P.UnitDelay_InitialCondition_fk; |
| 30079 | |
| 30080 | /* InitializeConditions for UnitDelay: '<S742>/Unit Delay' */ |
| 30081 | L4_MABX_DW.UnitDelay_DSTATE_ig = L4_MABX_P.UnitDelay_InitialCondition_if; |
| 30082 | |
| 30083 | /* InitializeConditions for UnitDelay: '<S746>/Delay Input1' */ |
| 30084 | L4_MABX_DW.DelayInput1_DSTATE_fl = L4_MABX_P.DetectFallNonpositive_vinit_g; |
| 30085 | |
| 30086 | /* InitializeConditions for UnitDelay: '<S748>/Unit Delay1' */ |
| 30087 | L4_MABX_DW.UnitDelay1_DSTATE_m0 = L4_MABX_P.UnitDelay1_InitialCondition_o; |
| 30088 | |
| 30089 | /* InitializeConditions for UnitDelay: '<S749>/Unit Delay' */ |
| 30090 | L4_MABX_DW.UnitDelay_DSTATE_e = L4_MABX_P.UnitDelay_InitialCondition_i; |
| 30091 | |
| 30092 | /* InitializeConditions for UnitDelay: '<S749>/Unit Delay1' */ |
| 30093 | L4_MABX_DW.UnitDelay1_DSTATE_l = L4_MABX_P.UnitDelay1_InitialCondition_h; |
| 30094 | |
| 30095 | /* InitializeConditions for UnitDelay: '<S10>/Unit_Delay' */ |
| 30096 | L4_MABX_DW.Unit_Delay_DSTATE_do = L4_MABX_P.Unit_Delay_InitialCondition_jp; |
| 30097 | |
| 30098 | /* SystemInitialize for Enabled SubSystem: '<S497>/AIR1' */ |
| 30099 | /* SystemInitialize for Outport: '<S498>/PneumaticSupplyPress' */ |
| 30100 | L4_MABX_B.SFunction1_o1_ce = L4_MABX_P.PneumaticSupplyPress_Y0; |
| 30101 | |
| 30102 | /* SystemInitialize for Outport: '<S498>/ParkingAnd_orTrailerAirPress' */ |
| 30103 | L4_MABX_B.SFunction1_o2_c4 = L4_MABX_P.ParkingAnd_orTrailerAirPress_Y0; |
| 30104 | |
| 30105 | /* SystemInitialize for Outport: '<S498>/ServiceBrakeCircuit1AirPress' */ |
| 30106 | L4_MABX_B.SFunction1_o3_ik = L4_MABX_P.ServiceBrakeCircuit1AirPress_Y0; |
| 30107 | |
| 30108 | /* SystemInitialize for Outport: '<S498>/ServiceBrakeCircuit2AirPress' */ |
| 30109 | L4_MABX_B.SFunction1_o4_nj = L4_MABX_P.ServiceBrakeCircuit2AirPress_Y0; |
| 30110 | |
| 30111 | /* SystemInitialize for Outport: '<S498>/AuxEquipmentSupplyPress' */ |
| 30112 | L4_MABX_B.SFunction1_o5_oy = L4_MABX_P.AuxEquipmentSupplyPress_Y0; |
| 30113 | |
| 30114 | /* SystemInitialize for Outport: '<S498>/AirSuspensionSupplyPress' */ |
| 30115 | L4_MABX_B.SFunction1_o6_bo = L4_MABX_P.AirSuspensionSupplyPress_Y0; |
| 30116 | |
| 30117 | /* SystemInitialize for Outport: '<S498>/AirCompressorStatus' */ |
| 30118 | L4_MABX_B.SFunction1_o7_fu = L4_MABX_P.AirCompressorStatus_Y0; |
| 30119 | |
| 30120 | /* SystemInitialize for Outport: '<S498>/PowertrainCircuitAirSupplyPress' */ |
| 30121 | L4_MABX_B.SFunction1_o8_an = L4_MABX_P.PowertrainCircuitAirSupplyPress; |
| 30122 | |
| 30123 | /* SystemInitialize for Outport: '<S498>/RX status' */ |
| 30124 | L4_MABX_B.SFunction1_o9_af = L4_MABX_P.RXstatus_Y0_h; |
| 30125 | |
| 30126 | /* SystemInitialize for Outport: '<S498>/RX time' */ |
| 30127 | L4_MABX_B.SFunction1_o10_j = L4_MABX_P.RXtime_Y0_h; |
| 30128 | |
| 30129 | /* SystemInitialize for Outport: '<S498>/RX delta time' */ |
| 30130 | L4_MABX_B.SFunction1_o11_kj = L4_MABX_P.RXdeltatime_Y0_f; |
| 30131 | |
| 30132 | /* End of SystemInitialize for SubSystem: '<S497>/AIR1' */ |
| 30133 | |
| 30134 | /* SystemInitialize for Enabled SubSystem: '<S499>/AMB' */ |
| 30135 | /* SystemInitialize for Outport: '<S500>/BarometricPress' */ |
| 30136 | L4_MABX_B.SFunction1_o1_ps = L4_MABX_P.BarometricPress_Y0; |
| 30137 | |
| 30138 | /* SystemInitialize for Outport: '<S500>/CabInteriorTemp' */ |
| 30139 | L4_MABX_B.SFunction1_o2_hy = L4_MABX_P.CabInteriorTemp_Y0; |
| 30140 | |
| 30141 | /* SystemInitialize for Outport: '<S500>/AmbientAirTemp' */ |
| 30142 | L4_MABX_B.SFunction1_o3_b1 = L4_MABX_P.AmbientAirTemp_Y0; |
| 30143 | |
| 30144 | /* SystemInitialize for Outport: '<S500>/EngAirIntakeTemp' */ |
| 30145 | L4_MABX_B.SFunction1_o4_c0 = L4_MABX_P.EngAirIntakeTemp_Y0; |
| 30146 | |
| 30147 | /* SystemInitialize for Outport: '<S500>/RoadSurfaceTemp' */ |
| 30148 | L4_MABX_B.SFunction1_o5_dq = L4_MABX_P.RoadSurfaceTemp_Y0; |
| 30149 | |
| 30150 | /* SystemInitialize for Outport: '<S500>/RX status' */ |
| 30151 | L4_MABX_B.SFunction1_o6_ee = L4_MABX_P.RXstatus_Y0_f; |
| 30152 | |
| 30153 | /* SystemInitialize for Outport: '<S500>/RX time' */ |
| 30154 | L4_MABX_B.SFunction1_o7_as = L4_MABX_P.RXtime_Y0_l; |
| 30155 | |
| 30156 | /* SystemInitialize for Outport: '<S500>/RX delta time' */ |
| 30157 | L4_MABX_B.SFunction1_o8_gn = L4_MABX_P.RXdeltatime_Y0_p; |
| 30158 | |
| 30159 | /* End of SystemInitialize for SubSystem: '<S499>/AMB' */ |
| 30160 | |
| 30161 | /* SystemInitialize for Atomic SubSystem: '<S849>/CAN_TX_1000ms' */ |
| 30162 | /* SystemInitialize for Enabled SubSystem: '<S869>/AIR1' */ |
| 30163 | /* SystemInitialize for Outport: '<S870>/TX status' */ |
| 30164 | L4_MABX_B.SFunction1_o1_iu = L4_MABX_P.TXstatus_Y0; |
| 30165 | |
| 30166 | /* SystemInitialize for Outport: '<S870>/TX time' */ |
| 30167 | L4_MABX_B.SFunction1_o2_nv = L4_MABX_P.TXtime_Y0; |
| 30168 | |
| 30169 | /* SystemInitialize for Outport: '<S870>/TX delta time' */ |
| 30170 | L4_MABX_B.SFunction1_o3_fu = L4_MABX_P.TXdeltatime_Y0; |
| 30171 | |
| 30172 | /* SystemInitialize for Outport: '<S870>/TX delay time' */ |
| 30173 | L4_MABX_B.SFunction1_o4_k = L4_MABX_P.TXdelaytime_Y0; |
| 30174 | |
| 30175 | /* End of SystemInitialize for SubSystem: '<S869>/AIR1' */ |
| 30176 | |
| 30177 | /* SystemInitialize for Enabled SubSystem: '<S877>/AMB' */ |
| 30178 | /* SystemInitialize for Outport: '<S878>/TX status' */ |
| 30179 | L4_MABX_B.SFunction1_o1_jf = L4_MABX_P.TXstatus_Y0_l; |
| 30180 | |
| 30181 | /* SystemInitialize for Outport: '<S878>/TX time' */ |
| 30182 | L4_MABX_B.SFunction1_o2_g5 = L4_MABX_P.TXtime_Y0_p; |
| 30183 | |
| 30184 | /* SystemInitialize for Outport: '<S878>/TX delta time' */ |
| 30185 | L4_MABX_B.SFunction1_o3_gz = L4_MABX_P.TXdeltatime_Y0_o; |
| 30186 | |
| 30187 | /* SystemInitialize for Outport: '<S878>/TX delay time' */ |
| 30188 | L4_MABX_B.SFunction1_o4_cf = L4_MABX_P.TXdelaytime_Y0_d; |
| 30189 | |
| 30190 | /* End of SystemInitialize for SubSystem: '<S877>/AMB' */ |
| 30191 | /* End of SystemInitialize for SubSystem: '<S849>/CAN_TX_1000ms' */ |
| 30192 | |
| 30193 | /* SystemInitialize for Chart: '<S845>/Chart' */ |
| 30194 | L4_MABX_DW.is_active_c5_SUB_ECU_L4_MABX_HW = 0U; |
| 30195 | L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 30196 | |
| 30197 | /* SystemInitialize for Chart: '<S763>/Health State Machine PWM Sensor 1' */ |
| 30198 | L4_MABX_DW.is_FAILURE_DETECTED_d = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 30199 | L4_MABX_DW.is_active_c9_SUB_ECU_L4_MABX_HW = 0U; |
| 30200 | L4_MABX_DW.is_c9_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 30201 | |
| 30202 | /* SystemInitialize for Chart: '<S763>/Health State Machine PWM Sensor 2' */ |
| 30203 | L4_MABX_DW.is_FAILURE_DETECTED = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 30204 | L4_MABX_DW.is_active_c10_SUB_ECU_L4_MABX_H = 0U; |
| 30205 | L4_MABX_DW.is_c10_SUB_ECU_L4_MABX_HW_Inter = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 30206 | |
| 30207 | /* SystemInitialize for Enabled SubSystem: '<S744>/Slew_at_event' */ |
| 30208 | /* InitializeConditions for UnitDelay: '<S838>/Unit_Delay' */ |
| 30209 | L4_MABX_DW.Unit_Delay_DSTATE_k = L4_MABX_P.Unit_Delay_InitialCondition_b10; |
| 30210 | |
| 30211 | /* InitializeConditions for UnitDelay: '<S839>/Unit_Delay' */ |
| 30212 | L4_MABX_DW.Unit_Delay_DSTATE_hv = L4_MABX_P.Unit_Delay_InitialCondition_ee; |
| 30213 | |
| 30214 | /* InitializeConditions for UnitDelay: '<S842>/FixPt Unit Delay2' */ |
| 30215 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_b = |
| 30216 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_ee; |
| 30217 | |
| 30218 | /* InitializeConditions for UnitDelay: '<S842>/FixPt Unit Delay1' */ |
| 30219 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_i = |
| 30220 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_c; |
| 30221 | |
| 30222 | /* InitializeConditions for UnitDelay: '<S837>/Unit_Delay' */ |
| 30223 | L4_MABX_DW.Unit_Delay_DSTATE_i4 = L4_MABX_P.Unit_Delay_InitialCondition_n; |
| 30224 | |
| 30225 | /* SystemInitialize for Outport: '<S767>/F_Out_slewing' */ |
| 30226 | L4_MABX_B.LogicalOperator_a = L4_MABX_P.F_Out_slewing_Y0_m; |
| 30227 | |
| 30228 | /* SystemInitialize for Outport: '<S767>/Out' */ |
| 30229 | L4_MABX_B.If_Then_Else_is.Switch = L4_MABX_P.Out_Y0_a; |
| 30230 | |
| 30231 | /* End of SystemInitialize for SubSystem: '<S744>/Slew_at_event' */ |
| 30232 | |
| 30233 | /* SystemInitialize for Enabled SubSystem: '<S507>/CCVS1_31' */ |
| 30234 | /* SystemInitialize for Outport: '<S508>/TwoSpeedAxleSwitch' */ |
| 30235 | L4_MABX_B.SFunction1_o1_ph = L4_MABX_P.TwoSpeedAxleSwitch_Y0_g; |
| 30236 | |
| 30237 | /* SystemInitialize for Outport: '<S508>/ParkingBrakeSwitch' */ |
| 30238 | L4_MABX_B.SFunction1_o2_bb = L4_MABX_P.ParkingBrakeSwitch_Y0_i; |
| 30239 | |
| 30240 | /* SystemInitialize for Outport: '<S508>/CruiseCtrlPauseSwitch' */ |
| 30241 | L4_MABX_B.SFunction1_o3_jz = L4_MABX_P.CruiseCtrlPauseSwitch_Y0_a; |
| 30242 | |
| 30243 | /* SystemInitialize for Outport: '<S508>/ParkBrakeReleaseInhibitRq' */ |
| 30244 | L4_MABX_B.SFunction1_o4_fx = L4_MABX_P.ParkBrakeReleaseInhibitRq_Y0_m; |
| 30245 | |
| 30246 | /* SystemInitialize for Outport: '<S508>/WheelBasedVehicleSpeed' */ |
| 30247 | L4_MABX_B.SFunction1_o5_go = L4_MABX_P.WheelBasedVehicleSpeed_Y0_l; |
| 30248 | |
| 30249 | /* SystemInitialize for Outport: '<S508>/CruiseCtrlActive' */ |
| 30250 | L4_MABX_B.SFunction1_o6_nc = L4_MABX_P.CruiseCtrlActive_Y0_b; |
| 30251 | |
| 30252 | /* SystemInitialize for Outport: '<S508>/CruiseCtrlEnableSwitch' */ |
| 30253 | L4_MABX_B.SFunction1_o7_oi = L4_MABX_P.CruiseCtrlEnableSwitch_Y0_d; |
| 30254 | |
| 30255 | /* SystemInitialize for Outport: '<S508>/BrakeSwitch' */ |
| 30256 | L4_MABX_B.SFunction1_o8_fx = L4_MABX_P.BrakeSwitch_Y0_d; |
| 30257 | |
| 30258 | /* SystemInitialize for Outport: '<S508>/ClutchSwitch' */ |
| 30259 | L4_MABX_B.SFunction1_o9_dt = L4_MABX_P.ClutchSwitch_Y0_e; |
| 30260 | |
| 30261 | /* SystemInitialize for Outport: '<S508>/CruiseCtrlSetSwitch' */ |
| 30262 | L4_MABX_B.SFunction1_o10_a2 = L4_MABX_P.CruiseCtrlSetSwitch_Y0_b; |
| 30263 | |
| 30264 | /* SystemInitialize for Outport: '<S508>/CruiseCtrlCoastSwitch' */ |
| 30265 | L4_MABX_B.SFunction1_o11_f = L4_MABX_P.CruiseCtrlCoastSwitch_Y0_d; |
| 30266 | |
| 30267 | /* SystemInitialize for Outport: '<S508>/CruiseCtrlResumeSwitch' */ |
| 30268 | L4_MABX_B.SFunction1_o12_e = L4_MABX_P.CruiseCtrlResumeSwitch_Y0_k; |
| 30269 | |
| 30270 | /* SystemInitialize for Outport: '<S508>/CruiseCtrlAccelerateSwitch' */ |
| 30271 | L4_MABX_B.SFunction1_o13_p0 = L4_MABX_P.CruiseCtrlAccelerateSwitch_Y0_b; |
| 30272 | |
| 30273 | /* SystemInitialize for Outport: '<S508>/CruiseCtrlSetSpeed' */ |
| 30274 | L4_MABX_B.SFunction1_o14_h = L4_MABX_P.CruiseCtrlSetSpeed_Y0_d; |
| 30275 | |
| 30276 | /* SystemInitialize for Outport: '<S508>/PTOGovernorState' */ |
| 30277 | L4_MABX_B.SFunction1_o15_m = L4_MABX_P.PTOGovernorState_Y0_e; |
| 30278 | |
| 30279 | /* SystemInitialize for Outport: '<S508>/CruiseCtrlStates' */ |
| 30280 | L4_MABX_B.SFunction1_o16_j = L4_MABX_P.CruiseCtrlStates_Y0_o; |
| 30281 | |
| 30282 | /* SystemInitialize for Outport: '<S508>/EngIdleIncrementSwitch' */ |
| 30283 | L4_MABX_B.SFunction1_o17_m = L4_MABX_P.EngIdleIncrementSwitch_Y0_l; |
| 30284 | |
| 30285 | /* SystemInitialize for Outport: '<S508>/EngIdleDecrementSwitch' */ |
| 30286 | L4_MABX_B.SFunction1_o18_n4 = L4_MABX_P.EngIdleDecrementSwitch_Y0_n; |
| 30287 | |
| 30288 | /* SystemInitialize for Outport: '<S508>/EngTestModeSwitch' */ |
| 30289 | L4_MABX_B.SFunction1_o19_lj = L4_MABX_P.EngTestModeSwitch_Y0_k; |
| 30290 | |
| 30291 | /* SystemInitialize for Outport: '<S508>/EngShutdownOverrideSwitch' */ |
| 30292 | L4_MABX_B.SFunction1_o20_m = L4_MABX_P.EngShutdownOverrideSwitch_Y0_m; |
| 30293 | |
| 30294 | /* SystemInitialize for Outport: '<S508>/RX status' */ |
| 30295 | L4_MABX_B.SFunction1_o21_h = L4_MABX_P.RXstatus_Y0_b; |
| 30296 | |
| 30297 | /* SystemInitialize for Outport: '<S508>/RX time' */ |
| 30298 | L4_MABX_B.SFunction1_o22_f = L4_MABX_P.RXtime_Y0_p; |
| 30299 | |
| 30300 | /* SystemInitialize for Outport: '<S508>/RX delta time' */ |
| 30301 | L4_MABX_B.SFunction1_o23_l = L4_MABX_P.RXdeltatime_Y0_e; |
| 30302 | |
| 30303 | /* End of SystemInitialize for SubSystem: '<S507>/CCVS1_31' */ |
| 30304 | |
| 30305 | /* SystemInitialize for Enabled SubSystem: '<S518>/EBC2_0B1' */ |
| 30306 | /* SystemInitialize for Outport: '<S519>/FrontAxleSpeed' */ |
| 30307 | L4_MABX_B.SFunction1_o1_ee = L4_MABX_P.FrontAxleSpeed_Y0; |
| 30308 | |
| 30309 | /* SystemInitialize for Outport: '<S519>/RelativeSpeedFrontAxleLeftWheel' */ |
| 30310 | L4_MABX_B.SFunction1_o2_eu = L4_MABX_P.RelativeSpeedFrontAxleLeftWheel; |
| 30311 | |
| 30312 | /* SystemInitialize for Outport: '<S519>/RlativeSpeedFrontAxleRightWheel' */ |
| 30313 | L4_MABX_B.SFunction1_o3_fx = L4_MABX_P.RlativeSpeedFrontAxleRightWheel; |
| 30314 | |
| 30315 | /* SystemInitialize for Outport: '<S519>/RelativeSpeedRearAxle1LeftWheel' */ |
| 30316 | L4_MABX_B.SFunction1_o4_as = L4_MABX_P.RelativeSpeedRearAxle1LeftWheel; |
| 30317 | |
| 30318 | /* SystemInitialize for Outport: '<S519>/RlativeSpeedRearAxle1RightWheel' */ |
| 30319 | L4_MABX_B.SFunction1_o5_aq = L4_MABX_P.RlativeSpeedRearAxle1RightWheel; |
| 30320 | |
| 30321 | /* SystemInitialize for Outport: '<S519>/RelativeSpeedRearAxle2LeftWheel' */ |
| 30322 | L4_MABX_B.SFunction1_o6_on = L4_MABX_P.RelativeSpeedRearAxle2LeftWheel; |
| 30323 | |
| 30324 | /* SystemInitialize for Outport: '<S519>/RlativeSpeedRearAxle2RightWheel' */ |
| 30325 | L4_MABX_B.SFunction1_o7_n = L4_MABX_P.RlativeSpeedRearAxle2RightWheel; |
| 30326 | |
| 30327 | /* SystemInitialize for Outport: '<S519>/RX status' */ |
| 30328 | L4_MABX_B.SFunction1_o8_c = L4_MABX_P.RXstatus_Y0_a5; |
| 30329 | |
| 30330 | /* SystemInitialize for Outport: '<S519>/RX time' */ |
| 30331 | L4_MABX_B.SFunction1_o9_aj = L4_MABX_P.RXtime_Y0_id; |
| 30332 | |
| 30333 | /* SystemInitialize for Outport: '<S519>/RX delta time' */ |
| 30334 | L4_MABX_B.SFunction1_o10_gi = L4_MABX_P.RXdeltatime_Y0_ot; |
| 30335 | |
| 30336 | /* End of SystemInitialize for SubSystem: '<S518>/EBC2_0B1' */ |
| 30337 | |
| 30338 | /* SystemInitialize for Enabled SubSystem: '<S576>/HRW_0B' */ |
| 30339 | /* SystemInitialize for Outport: '<S577>/FrontAxleLeftWheelSpeed' */ |
| 30340 | L4_MABX_B.SFunction1_o1_ag = L4_MABX_P.FrontAxleLeftWheelSpeed_Y0; |
| 30341 | |
| 30342 | /* SystemInitialize for Outport: '<S577>/FrontAxleRightWheelSpeed' */ |
| 30343 | L4_MABX_B.SFunction1_o2_na = L4_MABX_P.FrontAxleRightWheelSpeed_Y0; |
| 30344 | |
| 30345 | /* SystemInitialize for Outport: '<S577>/RearAxleLeftWheelSpeed' */ |
| 30346 | L4_MABX_B.SFunction1_o3_bm = L4_MABX_P.RearAxleLeftWheelSpeed_Y0; |
| 30347 | |
| 30348 | /* SystemInitialize for Outport: '<S577>/RearAxleRightWheelSpeed' */ |
| 30349 | L4_MABX_B.SFunction1_o4_awa = L4_MABX_P.RearAxleRightWheelSpeed_Y0; |
| 30350 | |
| 30351 | /* SystemInitialize for Outport: '<S577>/RX status' */ |
| 30352 | L4_MABX_B.SFunction1_o5_j1 = L4_MABX_P.RXstatus_Y0_i; |
| 30353 | |
| 30354 | /* SystemInitialize for Outport: '<S577>/RX time' */ |
| 30355 | L4_MABX_B.SFunction1_o6_gz = L4_MABX_P.RXtime_Y0_b; |
| 30356 | |
| 30357 | /* SystemInitialize for Outport: '<S577>/RX delta time' */ |
| 30358 | L4_MABX_B.SFunction1_o7_iy = L4_MABX_P.RXdeltatime_Y0_pl; |
| 30359 | |
| 30360 | /* End of SystemInitialize for SubSystem: '<S576>/HRW_0B' */ |
| 30361 | |
| 30362 | /* SystemInitialize for Enabled SubSystem: '<S516>/EBC1_0B' */ |
| 30363 | /* SystemInitialize for Outport: '<S517>/ASREngCtrlActive' */ |
| 30364 | L4_MABX_B.SFunction1_o1_ir = L4_MABX_P.ASREngCtrlActive_Y0_f; |
| 30365 | |
| 30366 | /* SystemInitialize for Outport: '<S517>/ASRBrakeCtrlActive' */ |
| 30367 | L4_MABX_B.SFunction1_o2_cb = L4_MABX_P.ASRBrakeCtrlActive_Y0_d; |
| 30368 | |
| 30369 | /* SystemInitialize for Outport: '<S517>/AntiLockBrakingActive' */ |
| 30370 | L4_MABX_B.SFunction1_o3_i1 = L4_MABX_P.AntiLockBrakingActive_Y0_h; |
| 30371 | |
| 30372 | /* SystemInitialize for Outport: '<S517>/EBSBrakeSwitch' */ |
| 30373 | L4_MABX_B.SFunction1_o4_mt = L4_MABX_P.EBSBrakeSwitch_Y0_e; |
| 30374 | |
| 30375 | /* SystemInitialize for Outport: '<S517>/BrakePedalPos' */ |
| 30376 | L4_MABX_B.SFunction1_o5_ma = L4_MABX_P.BrakePedalPos_Y0_f; |
| 30377 | |
| 30378 | /* SystemInitialize for Outport: '<S517>/ABSOffroadSwitch' */ |
| 30379 | L4_MABX_B.SFunction1_o6_ho = L4_MABX_P.ABSOffroadSwitch_Y0_j; |
| 30380 | |
| 30381 | /* SystemInitialize for Outport: '<S517>/ASROffroadSwitch' */ |
| 30382 | L4_MABX_B.SFunction1_o7_kf = L4_MABX_P.ASROffroadSwitch_Y0_o; |
| 30383 | |
| 30384 | /* SystemInitialize for Outport: '<S517>/ASRHillHolderSwitch' */ |
| 30385 | L4_MABX_B.SFunction1_o8_pf = L4_MABX_P.ASRHillHolderSwitch_Y0_i; |
| 30386 | |
| 30387 | /* SystemInitialize for Outport: '<S517>/TractionCtrlOverrideSwitch' */ |
| 30388 | L4_MABX_B.SFunction1_o9_oj = L4_MABX_P.TractionCtrlOverrideSwitch_Y0_m; |
| 30389 | |
| 30390 | /* SystemInitialize for Outport: '<S517>/AccelInterlockSwitch' */ |
| 30391 | L4_MABX_B.SFunction1_o10_d = L4_MABX_P.AccelInterlockSwitch_Y0_m; |
| 30392 | |
| 30393 | /* SystemInitialize for Outport: '<S517>/EngDerateSwitch' */ |
| 30394 | L4_MABX_B.SFunction1_o11_m = L4_MABX_P.EngDerateSwitch_Y0_p; |
| 30395 | |
| 30396 | /* SystemInitialize for Outport: '<S517>/EngAuxShutdownSwitch' */ |
| 30397 | L4_MABX_B.SFunction1_o12_b = L4_MABX_P.EngAuxShutdownSwitch_Y0_b; |
| 30398 | |
| 30399 | /* SystemInitialize for Outport: '<S517>/RemoteAccelEnableSwitch' */ |
| 30400 | L4_MABX_B.SFunction1_o13_p = L4_MABX_P.RemoteAccelEnableSwitch_Y0_d; |
| 30401 | |
| 30402 | /* SystemInitialize for Outport: '<S517>/EngRetarderSelection' */ |
| 30403 | L4_MABX_B.SFunction1_o14_e = L4_MABX_P.EngRetarderSelection_Y0_g; |
| 30404 | |
| 30405 | /* SystemInitialize for Outport: '<S517>/ABSFullyOperational' */ |
| 30406 | L4_MABX_B.SFunction1_o15_j = L4_MABX_P.ABSFullyOperational_Y0_o; |
| 30407 | |
| 30408 | /* SystemInitialize for Outport: '<S517>/EBSRedWarningSignal' */ |
| 30409 | L4_MABX_B.SFunction1_o16_f = L4_MABX_P.EBSRedWarningSignal_Y0_b; |
| 30410 | |
| 30411 | /* SystemInitialize for Outport: '<S517>/ABS_EBSAmberWarningSignal' */ |
| 30412 | L4_MABX_B.SFunction1_o17_h = L4_MABX_P.ABS_EBSAmberWarningSignal_Y0_b; |
| 30413 | |
| 30414 | /* SystemInitialize for Outport: '<S517>/ATC_ASRInformationSignal' */ |
| 30415 | L4_MABX_B.SFunction1_o18_o = L4_MABX_P.ATC_ASRInformationSignal_Y0_e; |
| 30416 | |
| 30417 | /* SystemInitialize for Outport: '<S517>/SrcAddrssOfCtrllngDvcFrBrkCntrl' */ |
| 30418 | L4_MABX_B.SFunction1_o19_f = L4_MABX_P.SrcAddrssOfCtrllngDvcFrBrkCnt_h; |
| 30419 | |
| 30420 | /* SystemInitialize for Outport: '<S517>/HaltBrakeSwitch' */ |
| 30421 | L4_MABX_B.SFunction1_o20_g = L4_MABX_P.HaltBrakeSwitch_Y0_n; |
| 30422 | |
| 30423 | /* SystemInitialize for Outport: '<S517>/TrailerABSStatus' */ |
| 30424 | L4_MABX_B.SFunction1_o21_f = L4_MABX_P.TrailerABSStatus_Y0_c; |
| 30425 | |
| 30426 | /* SystemInitialize for Outport: '<S517>/TrctrMntdTrilerABSWarningSignal' */ |
| 30427 | L4_MABX_B.SFunction1_o22_k = L4_MABX_P.TrctrMntdTrilerABSWarningSign_n; |
| 30428 | |
| 30429 | /* SystemInitialize for Outport: '<S517>/RX status' */ |
| 30430 | L4_MABX_B.SFunction1_o23_p = L4_MABX_P.RXstatus_Y0_ey; |
| 30431 | |
| 30432 | /* SystemInitialize for Outport: '<S517>/RX time' */ |
| 30433 | L4_MABX_B.SFunction1_o24_d = L4_MABX_P.RXtime_Y0_o; |
| 30434 | |
| 30435 | /* SystemInitialize for Outport: '<S517>/RX delta time' */ |
| 30436 | L4_MABX_B.SFunction1_o25_b = L4_MABX_P.RXdeltatime_Y0_lc; |
| 30437 | |
| 30438 | /* End of SystemInitialize for SubSystem: '<S516>/EBC1_0B' */ |
| 30439 | |
| 30440 | /* SystemInitialize for Enabled SubSystem: '<S571>/ETC2_031' */ |
| 30441 | /* SystemInitialize for Outport: '<S572>/SPN524_TransSelectedGear' */ |
| 30442 | L4_MABX_B.SFunction1_o1_m5 = L4_MABX_P.SPN524_TransSelectedGear_Y0; |
| 30443 | |
| 30444 | /* SystemInitialize for Outport: '<S572>/SPN526_TransActualGearRatio' */ |
| 30445 | L4_MABX_B.SFunction1_o2_lmj = L4_MABX_P.SPN526_TransActualGearRatio_Y0; |
| 30446 | |
| 30447 | /* SystemInitialize for Outport: '<S572>/SPN523_TransCurrentGear' */ |
| 30448 | L4_MABX_B.SFunction1_o3_g3 = L4_MABX_P.SPN523_TransCurrentGear_Y0; |
| 30449 | |
| 30450 | /* SystemInitialize for Outport: '<S572>/RX status' */ |
| 30451 | L4_MABX_B.SFunction1_o4_b2 = L4_MABX_P.RXstatus_Y0_bb; |
| 30452 | |
| 30453 | /* SystemInitialize for Outport: '<S572>/RX time' */ |
| 30454 | L4_MABX_B.SFunction1_o5_id = L4_MABX_P.RXtime_Y0_f; |
| 30455 | |
| 30456 | /* SystemInitialize for Outport: '<S572>/RX delta time' */ |
| 30457 | L4_MABX_B.SFunction1_o6_ks = L4_MABX_P.RXdeltatime_Y0_lx; |
| 30458 | |
| 30459 | /* End of SystemInitialize for SubSystem: '<S571>/ETC2_031' */ |
| 30460 | |
| 30461 | /* SystemInitialize for Enabled SubSystem: '<S565>/EEC1_001' */ |
| 30462 | /* SystemInitialize for Outport: '<S566>/EngTorqueMode' */ |
| 30463 | L4_MABX_B.SFunction1_o1_j3 = L4_MABX_P.EngTorqueMode_Y0; |
| 30464 | |
| 30465 | /* SystemInitialize for Outport: '<S566>/ActlEngPrcntTrqueHighResolution' */ |
| 30466 | L4_MABX_B.SFunction1_o2_eg = L4_MABX_P.ActlEngPrcntTrqueHighResolution; |
| 30467 | |
| 30468 | /* SystemInitialize for Outport: '<S566>/DriversDemandEngPercentTorque' */ |
| 30469 | L4_MABX_B.SFunction1_o3_lv = L4_MABX_P.DriversDemandEngPercentTorque_Y; |
| 30470 | |
| 30471 | /* SystemInitialize for Outport: '<S566>/ActualEngPercentTorque' */ |
| 30472 | L4_MABX_B.SFunction1_o4_jq = L4_MABX_P.ActualEngPercentTorque_Y0; |
| 30473 | |
| 30474 | /* SystemInitialize for Outport: '<S566>/EngSpeed' */ |
| 30475 | L4_MABX_B.SFunction1_o5_l = L4_MABX_P.EngSpeed_Y0; |
| 30476 | |
| 30477 | /* SystemInitialize for Outport: '<S566>/SrcAddrssOfCtrllngDvcFrEngCntrl' */ |
| 30478 | L4_MABX_B.SFunction1_o6_o = L4_MABX_P.SrcAddrssOfCtrllngDvcFrEngCntrl; |
| 30479 | |
| 30480 | /* SystemInitialize for Outport: '<S566>/EngStarterMode' */ |
| 30481 | L4_MABX_B.SFunction1_o7_i3 = L4_MABX_P.EngStarterMode_Y0; |
| 30482 | |
| 30483 | /* SystemInitialize for Outport: '<S566>/EngDemandPercentTorque' */ |
| 30484 | L4_MABX_B.SFunction1_o8_e = L4_MABX_P.EngDemandPercentTorque_Y0; |
| 30485 | |
| 30486 | /* SystemInitialize for Outport: '<S566>/RX status' */ |
| 30487 | L4_MABX_B.SFunction1_o9_jd = L4_MABX_P.RXstatus_Y0_c; |
| 30488 | |
| 30489 | /* SystemInitialize for Outport: '<S566>/RX time' */ |
| 30490 | L4_MABX_B.SFunction1_o10_f = L4_MABX_P.RXtime_Y0_l0; |
| 30491 | |
| 30492 | /* SystemInitialize for Outport: '<S566>/RX delta time' */ |
| 30493 | L4_MABX_B.SFunction1_o11_g = L4_MABX_P.RXdeltatime_Y0_i; |
| 30494 | |
| 30495 | /* End of SystemInitialize for SubSystem: '<S565>/EEC1_001' */ |
| 30496 | |
| 30497 | /* SystemInitialize for Enabled SubSystem: '<S569>/EEC3_001' */ |
| 30498 | /* SystemInitialize for Outport: '<S570>/SPN514_NominalFrictionPercentTorque' */ |
| 30499 | L4_MABX_B.SFunction1_o1_f4 = L4_MABX_P.SPN514_NominalFrictionPercentTo; |
| 30500 | |
| 30501 | /* SystemInitialize for Outport: '<S570>/SPN2978_EstEngParasiticLossesPercentTorque' */ |
| 30502 | L4_MABX_B.SFunction1_o2_d3 = L4_MABX_P.SPN2978_EstEngParasiticLossesPe; |
| 30503 | |
| 30504 | /* SystemInitialize for Outport: '<S570>/RX status' */ |
| 30505 | L4_MABX_B.SFunction1_o3_jb = L4_MABX_P.RXstatus_Y0_ge; |
| 30506 | |
| 30507 | /* SystemInitialize for Outport: '<S570>/RX time' */ |
| 30508 | L4_MABX_B.SFunction1_o4_of = L4_MABX_P.RXtime_Y0_a0; |
| 30509 | |
| 30510 | /* SystemInitialize for Outport: '<S570>/RX delta time' */ |
| 30511 | L4_MABX_B.SFunction1_o5_i1 = L4_MABX_P.RXdeltatime_Y0_cd; |
| 30512 | |
| 30513 | /* End of SystemInitialize for SubSystem: '<S569>/EEC3_001' */ |
| 30514 | |
| 30515 | /* SystemInitialize for Enabled SubSystem: '<S512>/CVW_0B1' */ |
| 30516 | /* SystemInitialize for Outport: '<S513>/SPN1760_GrossCombinationVehicleWeight' */ |
| 30517 | L4_MABX_B.SFunction1_o1_h5 = L4_MABX_P.SPN1760_GrossCombinationVehicle; |
| 30518 | |
| 30519 | /* SystemInitialize for Outport: '<S513>/RX status' */ |
| 30520 | L4_MABX_B.SFunction1_o2_ln = L4_MABX_P.RXstatus_Y0_e; |
| 30521 | |
| 30522 | /* SystemInitialize for Outport: '<S513>/RX time' */ |
| 30523 | L4_MABX_B.SFunction1_o3_ji = L4_MABX_P.RXtime_Y0_i; |
| 30524 | |
| 30525 | /* SystemInitialize for Outport: '<S513>/RX delta time' */ |
| 30526 | L4_MABX_B.SFunction1_o4_fk = L4_MABX_P.RXdeltatime_Y0_gf; |
| 30527 | |
| 30528 | /* End of SystemInitialize for SubSystem: '<S512>/CVW_0B1' */ |
| 30529 | |
| 30530 | /* SystemInitialize for Enabled SubSystem: '<S493>/ACC1_2A_' */ |
| 30531 | /* SystemInitialize for Outport: '<S494>/SpeedOfForwardVehicle' */ |
| 30532 | L4_MABX_B.SFunction1_o1_da = L4_MABX_P.SpeedOfForwardVehicle_Y0; |
| 30533 | |
| 30534 | /* SystemInitialize for Outport: '<S494>/DistanceToForwardVehicle' */ |
| 30535 | L4_MABX_B.SFunction1_o2_f0 = L4_MABX_P.DistanceToForwardVehicle_Y0; |
| 30536 | |
| 30537 | /* SystemInitialize for Outport: '<S494>/AdaptiveCruiseCtrlSetSpeed' */ |
| 30538 | L4_MABX_B.SFunction1_o3_ef = L4_MABX_P.AdaptiveCruiseCtrlSetSpeed_Y0; |
| 30539 | |
| 30540 | /* SystemInitialize for Outport: '<S494>/AdaptiveCruiseCtrlMode' */ |
| 30541 | L4_MABX_B.SFunction1_o4_b32 = L4_MABX_P.AdaptiveCruiseCtrlMode_Y0; |
| 30542 | |
| 30543 | /* SystemInitialize for Outport: '<S494>/AdptveCruiseCtrlSetDistanceMode' */ |
| 30544 | L4_MABX_B.SFunction1_o5_h = L4_MABX_P.AdptveCruiseCtrlSetDistanceMode; |
| 30545 | |
| 30546 | /* SystemInitialize for Outport: '<S494>/RoadCurvature' */ |
| 30547 | L4_MABX_B.SFunction1_o6_px = L4_MABX_P.RoadCurvature_Y0; |
| 30548 | |
| 30549 | /* SystemInitialize for Outport: '<S494>/ACCTargetDetected' */ |
| 30550 | L4_MABX_B.SFunction1_o7_h = L4_MABX_P.ACCTargetDetected_Y0; |
| 30551 | |
| 30552 | /* SystemInitialize for Outport: '<S494>/ACCSystemShutoffWarning' */ |
| 30553 | L4_MABX_B.SFunction1_o8_gf = L4_MABX_P.ACCSystemShutoffWarning_Y0; |
| 30554 | |
| 30555 | /* SystemInitialize for Outport: '<S494>/ACCDistanceAlertSignal' */ |
| 30556 | L4_MABX_B.SFunction1_o9_jm = L4_MABX_P.ACCDistanceAlertSignal_Y0; |
| 30557 | |
| 30558 | /* SystemInitialize for Outport: '<S494>/ForwardCollisionWarning' */ |
| 30559 | L4_MABX_B.SFunction1_o10_e = L4_MABX_P.ForwardCollisionWarning_Y0; |
| 30560 | |
| 30561 | /* SystemInitialize for Outport: '<S494>/RX status' */ |
| 30562 | L4_MABX_B.SFunction1_o11_gx = L4_MABX_P.RXstatus_Y0_g; |
| 30563 | |
| 30564 | /* SystemInitialize for Outport: '<S494>/RX time' */ |
| 30565 | L4_MABX_B.SFunction1_o12_o = L4_MABX_P.RXtime_Y0_n; |
| 30566 | |
| 30567 | /* SystemInitialize for Outport: '<S494>/RX delta time' */ |
| 30568 | L4_MABX_B.SFunction1_o13_be = L4_MABX_P.RXdeltatime_Y0_c; |
| 30569 | |
| 30570 | /* End of SystemInitialize for SubSystem: '<S493>/ACC1_2A_' */ |
| 30571 | |
| 30572 | /* SystemInitialize for Enabled SubSystem: '<S475>/CAN_TYPE1_RX_M1_C1' */ |
| 30573 | /* SystemInitialize for Outport: '<S477>/byte1' */ |
| 30574 | L4_MABX_B.SFunction1_o1_ix = L4_MABX_P.byte1_Y0; |
| 30575 | |
| 30576 | /* SystemInitialize for Outport: '<S477>/byte2' */ |
| 30577 | L4_MABX_B.SFunction1_o2_j2 = L4_MABX_P.byte2_Y0; |
| 30578 | |
| 30579 | /* SystemInitialize for Outport: '<S477>/byte3' */ |
| 30580 | L4_MABX_B.SFunction1_o3_p4p = L4_MABX_P.byte3_Y0; |
| 30581 | |
| 30582 | /* SystemInitialize for Outport: '<S477>/byte4' */ |
| 30583 | L4_MABX_B.SFunction1_o4_k2 = L4_MABX_P.byte4_Y0; |
| 30584 | |
| 30585 | /* SystemInitialize for Outport: '<S477>/byte5' */ |
| 30586 | L4_MABX_B.SFunction1_o5_fy = L4_MABX_P.byte5_Y0; |
| 30587 | |
| 30588 | /* SystemInitialize for Outport: '<S477>/byte6' */ |
| 30589 | L4_MABX_B.SFunction1_o6_ii = L4_MABX_P.byte6_Y0; |
| 30590 | |
| 30591 | /* SystemInitialize for Outport: '<S477>/byte7' */ |
| 30592 | L4_MABX_B.SFunction1_o7_gj = L4_MABX_P.byte7_Y0; |
| 30593 | |
| 30594 | /* SystemInitialize for Outport: '<S477>/byte8' */ |
| 30595 | L4_MABX_B.SFunction1_o8_fb = L4_MABX_P.byte8_Y0; |
| 30596 | |
| 30597 | /* SystemInitialize for Outport: '<S477>/RX status' */ |
| 30598 | L4_MABX_B.SFunction1_o9_np = L4_MABX_P.RXstatus_Y0; |
| 30599 | |
| 30600 | /* SystemInitialize for Outport: '<S477>/RX time' */ |
| 30601 | L4_MABX_B.SFunction1_o10_j1 = L4_MABX_P.RXtime_Y0; |
| 30602 | |
| 30603 | /* SystemInitialize for Outport: '<S477>/RX delta time' */ |
| 30604 | L4_MABX_B.SFunction1_o11_ja = L4_MABX_P.RXdeltatime_Y0; |
| 30605 | |
| 30606 | /* End of SystemInitialize for SubSystem: '<S475>/CAN_TYPE1_RX_M1_C1' */ |
| 30607 | |
| 30608 | /* SystemInitialize for Enabled SubSystem: '<S469>/Decode_TPCM_BAM' */ |
| 30609 | /* SystemInitialize for Outport: '<S687>/Out' */ |
| 30610 | L4_MABX_B.SPN2556_ControlByte_i = (uint8_T)L4_MABX_P.Out_Y0_l; |
| 30611 | L4_MABX_B.DataType_bh = (uint16_T)L4_MABX_P.Out_Y0_l; |
| 30612 | L4_MABX_B.SPN2568_TotalNumberOfPackets = (uint8_T)L4_MABX_P.Out_Y0_l; |
| 30613 | L4_MABX_B.DataType_e3 = (uint32_T)L4_MABX_P.Out_Y0_l; |
| 30614 | |
| 30615 | /* End of SystemInitialize for SubSystem: '<S469>/Decode_TPCM_BAM' */ |
| 30616 | |
| 30617 | /* SystemInitialize for Enabled SubSystem: '<S484>/CAN_TYPE1_RX_M1_C1' */ |
| 30618 | /* SystemInitialize for Outport: '<S486>/byte1' */ |
| 30619 | L4_MABX_B.SFunction1_o1_ok = L4_MABX_P.byte1_Y0_l; |
| 30620 | |
| 30621 | /* SystemInitialize for Outport: '<S486>/byte2' */ |
| 30622 | L4_MABX_B.SFunction1_o2_lo = L4_MABX_P.byte2_Y0_p; |
| 30623 | |
| 30624 | /* SystemInitialize for Outport: '<S486>/byte3' */ |
| 30625 | L4_MABX_B.SFunction1_o3_ps = L4_MABX_P.byte3_Y0_j; |
| 30626 | |
| 30627 | /* SystemInitialize for Outport: '<S486>/byte4' */ |
| 30628 | L4_MABX_B.SFunction1_o4_iz = L4_MABX_P.byte4_Y0_b; |
| 30629 | |
| 30630 | /* SystemInitialize for Outport: '<S486>/byte5' */ |
| 30631 | L4_MABX_B.SFunction1_o5_hi = L4_MABX_P.byte5_Y0_b; |
| 30632 | |
| 30633 | /* SystemInitialize for Outport: '<S486>/byte6' */ |
| 30634 | L4_MABX_B.SFunction1_o6_nx = L4_MABX_P.byte6_Y0_m; |
| 30635 | |
| 30636 | /* SystemInitialize for Outport: '<S486>/byte7' */ |
| 30637 | L4_MABX_B.SFunction1_o7_hn = L4_MABX_P.byte7_Y0_g; |
| 30638 | |
| 30639 | /* SystemInitialize for Outport: '<S486>/byte8' */ |
| 30640 | L4_MABX_B.SFunction1_o8_pn = L4_MABX_P.byte8_Y0_c; |
| 30641 | |
| 30642 | /* SystemInitialize for Outport: '<S486>/RX status' */ |
| 30643 | L4_MABX_B.SFunction1_o9_p = L4_MABX_P.RXstatus_Y0_j; |
| 30644 | |
| 30645 | /* SystemInitialize for Outport: '<S486>/RX time' */ |
| 30646 | L4_MABX_B.SFunction1_o10_iw = L4_MABX_P.RXtime_Y0_m; |
| 30647 | |
| 30648 | /* SystemInitialize for Outport: '<S486>/RX delta time' */ |
| 30649 | L4_MABX_B.SFunction1_o11_h = L4_MABX_P.RXdeltatime_Y0_o; |
| 30650 | |
| 30651 | /* End of SystemInitialize for SubSystem: '<S484>/CAN_TYPE1_RX_M1_C1' */ |
| 30652 | |
| 30653 | /* SystemInitialize for S-Function (rti_commonblock): '<S848>/S-Function1' incorporates: |
| 30654 | * SubSystem: '<S417>/IncrementTimer' |
| 30655 | */ |
| 30656 | L4_MABX_IncrementTimer_Init(); |
| 30657 | |
| 30658 | /* End of SystemInitialize for S-Function (rti_commonblock): '<S848>/S-Function1' */ |
| 30659 | |
| 30660 | /* SystemInitialize for Enabled SubSystem: '<S436>/CAN_RX_EC1_00' */ |
| 30661 | /* SystemInitialize for Enabled SubSystem: '<S520>/Decode' */ |
| 30662 | /* InitializeConditions for UnitDelay: '<S523>/Unit_Delay' */ |
| 30663 | L4_MABX_DW.Unit_Delay_DSTATE_lq = L4_MABX_P.Unit_Delay_InitialCondition_a; |
| 30664 | for (i = 0; i < 39; i++) { |
| 30665 | /* InitializeConditions for UnitDelay: '<S520>/Unit Delay' */ |
| 30666 | L4_MABX_DW.UnitDelay_DSTATE_l[i] = |
| 30667 | L4_MABX_P.UnitDelay_InitialCondition_nk[i]; |
| 30668 | |
| 30669 | /* SystemInitialize for Outport: '<S523>/RawData' */ |
| 30670 | L4_MABX_B.Inport_g[i] = L4_MABX_P.RawData_Y0; |
| 30671 | } |
| 30672 | |
| 30673 | /* SystemInitialize for Outport: '<S523>/RX_time' */ |
| 30674 | L4_MABX_B.timeStamp_o = L4_MABX_P.RX_time_Y0; |
| 30675 | |
| 30676 | /* SystemInitialize for Outport: '<S523>/RX_delta_time' */ |
| 30677 | L4_MABX_B.Subtract_k0 = L4_MABX_P.RX_delta_time_Y0; |
| 30678 | |
| 30679 | /* End of SystemInitialize for SubSystem: '<S520>/Decode' */ |
| 30680 | |
| 30681 | /* SystemInitialize for Outport: '<S520>/RX_status' */ |
| 30682 | L4_MABX_B.RX_status_kj = L4_MABX_P.RX_status_Y0; |
| 30683 | |
| 30684 | /* End of SystemInitialize for SubSystem: '<S436>/CAN_RX_EC1_00' */ |
| 30685 | |
| 30686 | /* SystemInitialize for Enabled SubSystem: '<S642>/VDC1_0B_' */ |
| 30687 | /* SystemInitialize for Outport: '<S643>/VDCInformationSignal' */ |
| 30688 | L4_MABX_B.SFunction1_o1_n1 = L4_MABX_P.VDCInformationSignal_Y0; |
| 30689 | |
| 30690 | /* SystemInitialize for Outport: '<S643>/VDCFullyOperational' */ |
| 30691 | L4_MABX_B.SFunction1_o2_j = L4_MABX_P.VDCFullyOperational_Y0; |
| 30692 | |
| 30693 | /* SystemInitialize for Outport: '<S643>/VDCBrakeLightRq' */ |
| 30694 | L4_MABX_B.SFunction1_o3_pa = L4_MABX_P.VDCBrakeLightRq_Y0; |
| 30695 | |
| 30696 | /* SystemInitialize for Outport: '<S643>/ROPEngCtrlActive' */ |
| 30697 | L4_MABX_B.SFunction1_o4_bm = L4_MABX_P.ROPEngCtrlActive_Y0; |
| 30698 | |
| 30699 | /* SystemInitialize for Outport: '<S643>/ROPBrakeCtrlActive' */ |
| 30700 | L4_MABX_B.SFunction1_o5_b = L4_MABX_P.ROPBrakeCtrlActive_Y0; |
| 30701 | |
| 30702 | /* SystemInitialize for Outport: '<S643>/YCEngCtrlActive' */ |
| 30703 | L4_MABX_B.SFunction1_o6_e = L4_MABX_P.YCEngCtrlActive_Y0; |
| 30704 | |
| 30705 | /* SystemInitialize for Outport: '<S643>/YCBrakeCtrlActive' */ |
| 30706 | L4_MABX_B.SFunction1_o7_a = L4_MABX_P.YCBrakeCtrlActive_Y0; |
| 30707 | |
| 30708 | /* SystemInitialize for Outport: '<S643>/RX status' */ |
| 30709 | L4_MABX_B.SFunction1_o8_b = L4_MABX_P.RXstatus_Y0_a2; |
| 30710 | |
| 30711 | /* SystemInitialize for Outport: '<S643>/RX time' */ |
| 30712 | L4_MABX_B.SFunction1_o9_g = L4_MABX_P.RXtime_Y0_ig; |
| 30713 | |
| 30714 | /* SystemInitialize for Outport: '<S643>/RX delta time' */ |
| 30715 | L4_MABX_B.SFunction1_o10 = L4_MABX_P.RXdeltatime_Y0_ex; |
| 30716 | |
| 30717 | /* End of SystemInitialize for SubSystem: '<S642>/VDC1_0B_' */ |
| 30718 | |
| 30719 | /* SystemInitialize for Enabled SubSystem: '<S644>/VDC2_0B1' */ |
| 30720 | /* SystemInitialize for Outport: '<S645>/SteerWheelAngle' */ |
| 30721 | SteerWheelAngle = L4_MABX_P.SteerWheelAngle_Y0; |
| 30722 | |
| 30723 | /* SystemInitialize for Outport: '<S645>/SteerWheelTurnCounter' */ |
| 30724 | L4_MABX_B.SFunction1_o2_gl = L4_MABX_P.SteerWheelTurnCounter_Y0; |
| 30725 | |
| 30726 | /* SystemInitialize for Outport: '<S645>/SteerWheelAngleSensorType' */ |
| 30727 | L4_MABX_B.SFunction1_o3_gw = L4_MABX_P.SteerWheelAngleSensorType_Y0; |
| 30728 | |
| 30729 | /* SystemInitialize for Outport: '<S645>/YawRate' */ |
| 30730 | YawRate = L4_MABX_P.YawRate_Y0; |
| 30731 | |
| 30732 | /* SystemInitialize for Outport: '<S645>/LateralAcceleration' */ |
| 30733 | L4_MABX_B.SFunction1_o5_d = L4_MABX_P.LateralAcceleration_Y0; |
| 30734 | |
| 30735 | /* SystemInitialize for Outport: '<S645>/LongitudinalAcceleration' */ |
| 30736 | SPN1810_LongitudinalAcceleration = L4_MABX_P.LongitudinalAcceleration_Y0; |
| 30737 | |
| 30738 | /* SystemInitialize for Outport: '<S645>/RX status' */ |
| 30739 | L4_MABX_B.SFunction1_o7_c = L4_MABX_P.RXstatus_Y0_dy; |
| 30740 | |
| 30741 | /* SystemInitialize for Outport: '<S645>/RX time' */ |
| 30742 | L4_MABX_B.SFunction1_o8_d = L4_MABX_P.RXtime_Y0_d; |
| 30743 | |
| 30744 | /* SystemInitialize for Outport: '<S645>/RX delta time' */ |
| 30745 | L4_MABX_B.SFunction1_o9 = L4_MABX_P.RXdeltatime_Y0_hr; |
| 30746 | |
| 30747 | /* End of SystemInitialize for SubSystem: '<S644>/VDC2_0B1' */ |
| 30748 | |
| 30749 | /* SystemInitialize for Enabled SubSystem: '<S459>/CAN_RX_VI_00' */ |
| 30750 | /* SystemInitialize for Enabled SubSystem: '<S648>/Decode' */ |
| 30751 | /* InitializeConditions for UnitDelay: '<S651>/Unit_Delay' */ |
| 30752 | L4_MABX_DW.Unit_Delay_DSTATE_f = L4_MABX_P.Unit_Delay_InitialCondition_f5; |
| 30753 | for (i = 0; i < 17; i++) { |
| 30754 | /* InitializeConditions for UnitDelay: '<S648>/Unit Delay' */ |
| 30755 | L4_MABX_DW.UnitDelay_DSTATE_bh[i] = |
| 30756 | L4_MABX_P.UnitDelay_InitialCondition_i1[i]; |
| 30757 | |
| 30758 | /* SystemInitialize for Outport: '<S651>/RawData' */ |
| 30759 | L4_MABX_B.Inport[i] = L4_MABX_P.RawData_Y0_g; |
| 30760 | } |
| 30761 | |
| 30762 | /* SystemInitialize for Outport: '<S651>/RX_time' */ |
| 30763 | L4_MABX_B.timeStamp = L4_MABX_P.RX_time_Y0_p; |
| 30764 | |
| 30765 | /* SystemInitialize for Outport: '<S651>/RX_delta_time' */ |
| 30766 | L4_MABX_B.Subtract_bm = L4_MABX_P.RX_delta_time_Y0_d; |
| 30767 | |
| 30768 | /* End of SystemInitialize for SubSystem: '<S648>/Decode' */ |
| 30769 | |
| 30770 | /* SystemInitialize for Outport: '<S648>/RX_status' */ |
| 30771 | L4_MABX_B.RX_status_dx = L4_MABX_P.RX_status_Y0_e; |
| 30772 | |
| 30773 | /* End of SystemInitialize for SubSystem: '<S459>/CAN_RX_VI_00' */ |
| 30774 | |
| 30775 | /* SystemInitialize for Enabled SubSystem: '<S630>/SSI2_031' */ |
| 30776 | /* SystemInitialize for Outport: '<S631>/PitchAngleExRange' */ |
| 30777 | L4_MABX_B.SFunction1_o1_ho = L4_MABX_P.PitchAngleExRange_Y0; |
| 30778 | |
| 30779 | /* SystemInitialize for Outport: '<S631>/RollAngleExRange' */ |
| 30780 | L4_MABX_B.SFunction1_o2_kf = L4_MABX_P.RollAngleExRange_Y0; |
| 30781 | |
| 30782 | /* SystemInitialize for Outport: '<S631>/PitchAngleExRangeCompensation' */ |
| 30783 | L4_MABX_B.SFunction1_o3_j = L4_MABX_P.PitchAngleExRangeCompensation_Y; |
| 30784 | |
| 30785 | /* SystemInitialize for Outport: '<S631>/PitchAngleExRangeFigureOfMerit' */ |
| 30786 | L4_MABX_B.SFunction1_o4_cv = L4_MABX_P.PitchAngleExRangeFigureOfMerit_; |
| 30787 | |
| 30788 | /* SystemInitialize for Outport: '<S631>/RollAngleExRangeCompensation' */ |
| 30789 | L4_MABX_B.SFunction1_o5_n = L4_MABX_P.RollAngleExRangeCompensation_Y0; |
| 30790 | |
| 30791 | /* SystemInitialize for Outport: '<S631>/RollAngleExRangeFigureOfMerit' */ |
| 30792 | L4_MABX_B.SFunction1_o6_n = L4_MABX_P.RollAngleExRangeFigureOfMerit_Y; |
| 30793 | |
| 30794 | /* SystemInitialize for Outport: '<S631>/RllAndPtchExRngMsurementLatency' */ |
| 30795 | L4_MABX_B.SFunction1_o7_k = L4_MABX_P.RllAndPtchExRngMsurementLatency; |
| 30796 | |
| 30797 | /* SystemInitialize for Outport: '<S631>/RX status' */ |
| 30798 | L4_MABX_B.SFunction1_o8_b4 = L4_MABX_P.RXstatus_Y0_fh; |
| 30799 | |
| 30800 | /* SystemInitialize for Outport: '<S631>/RX time' */ |
| 30801 | L4_MABX_B.SFunction1_o9_k = L4_MABX_P.RXtime_Y0_mg; |
| 30802 | |
| 30803 | /* SystemInitialize for Outport: '<S631>/RX delta time' */ |
| 30804 | L4_MABX_B.SFunction1_o10_n = L4_MABX_P.RXdeltatime_Y0_ez; |
| 30805 | |
| 30806 | /* End of SystemInitialize for SubSystem: '<S630>/SSI2_031' */ |
| 30807 | |
| 30808 | /* SystemInitialize for Enabled SubSystem: '<S621>/PX2_LanePosEst' */ |
| 30809 | /* SystemInitialize for Outport: '<S624>/PX2_LanePosEstAngle' */ |
| 30810 | L4_MABX_B.SFunction1_o1_d5 = L4_MABX_P.PX2_LanePosEstAngle_Y0; |
| 30811 | |
| 30812 | /* SystemInitialize for Outport: '<S624>/PX2_LanePosEstNumPoints' */ |
| 30813 | L4_MABX_B.SFunction1_o2_b = L4_MABX_P.PX2_LanePosEstNumPoints_Y0; |
| 30814 | |
| 30815 | /* SystemInitialize for Outport: '<S624>/PX2_LanePosEstPosition' */ |
| 30816 | L4_MABX_B.SFunction1_o3_pj = L4_MABX_P.PX2_LanePosEstPosition_Y0; |
| 30817 | |
| 30818 | /* SystemInitialize for Outport: '<S624>/PX2_LanePosEstNumLanes' */ |
| 30819 | L4_MABX_B.SFunction1_o4_oa = L4_MABX_P.PX2_LanePosEstNumLanes_Y0; |
| 30820 | |
| 30821 | /* SystemInitialize for Outport: '<S624>/RX status' */ |
| 30822 | L4_MABX_B.SFunction1_o5_et = L4_MABX_P.RXstatus_Y0_fx; |
| 30823 | |
| 30824 | /* SystemInitialize for Outport: '<S624>/RX time' */ |
| 30825 | L4_MABX_B.SFunction1_o6_h = L4_MABX_P.RXtime_Y0_iq; |
| 30826 | |
| 30827 | /* SystemInitialize for Outport: '<S624>/RX delta time' */ |
| 30828 | L4_MABX_B.SFunction1_o7_aw = L4_MABX_P.RXdeltatime_Y0_la; |
| 30829 | |
| 30830 | /* End of SystemInitialize for SubSystem: '<S621>/PX2_LanePosEst' */ |
| 30831 | |
| 30832 | /* SystemInitialize for Enabled SubSystem: '<S628>/Bendix_Prop2C2_Status_30' */ |
| 30833 | /* SystemInitialize for Outport: '<S629>/PressureP4' */ |
| 30834 | L4_MABX_B.SFunction1_o1_ii = L4_MABX_P.PressureP4_Y0; |
| 30835 | |
| 30836 | /* SystemInitialize for Outport: '<S629>/PressureP1' */ |
| 30837 | L4_MABX_B.SFunction1_o2_jx = L4_MABX_P.PressureP1_Y0; |
| 30838 | |
| 30839 | /* SystemInitialize for Outport: '<S629>/PressureP21' */ |
| 30840 | L4_MABX_B.SFunction1_o3_e = L4_MABX_P.PressureP21_Y0; |
| 30841 | |
| 30842 | /* SystemInitialize for Outport: '<S629>/PressureP22' */ |
| 30843 | L4_MABX_B.SFunction1_o4_h = L4_MABX_P.PressureP22_Y0; |
| 30844 | |
| 30845 | /* SystemInitialize for Outport: '<S629>/PressureP42' */ |
| 30846 | L4_MABX_B.SFunction1_o5_gv = L4_MABX_P.PressureP42_Y0; |
| 30847 | |
| 30848 | /* SystemInitialize for Outport: '<S629>/XPR1ControlStatus' */ |
| 30849 | L4_MABX_B.SFunction1_o6_b2 = L4_MABX_P.XPR1ControlStatus_Y0; |
| 30850 | |
| 30851 | /* SystemInitialize for Outport: '<S629>/XPR2ControlStatus' */ |
| 30852 | L4_MABX_B.SFunction1_o7_cy = L4_MABX_P.XPR2ControlStatus_Y0; |
| 30853 | |
| 30854 | /* SystemInitialize for Outport: '<S629>/XPR3ControlStatus' */ |
| 30855 | L4_MABX_B.SFunction1_o8_a5 = L4_MABX_P.XPR3ControlStatus_Y0; |
| 30856 | |
| 30857 | /* SystemInitialize for Outport: '<S629>/XPRErrorState' */ |
| 30858 | L4_MABX_B.SFunction1_o9_n = L4_MABX_P.XPRErrorState_Y0; |
| 30859 | |
| 30860 | /* SystemInitialize for Outport: '<S629>/XPRControlMode' */ |
| 30861 | L4_MABX_B.SFunction1_o10_a = L4_MABX_P.XPRControlMode_Y0; |
| 30862 | |
| 30863 | /* SystemInitialize for Outport: '<S629>/RX status' */ |
| 30864 | L4_MABX_B.SFunction1_o11_p = L4_MABX_P.RXstatus_Y0_mp; |
| 30865 | |
| 30866 | /* SystemInitialize for Outport: '<S629>/RX time' */ |
| 30867 | L4_MABX_B.SFunction1_o12_i = L4_MABX_P.RXtime_Y0_pv; |
| 30868 | |
| 30869 | /* SystemInitialize for Outport: '<S629>/RX delta time' */ |
| 30870 | L4_MABX_B.SFunction1_o13_b = L4_MABX_P.RXdeltatime_Y0_nj; |
| 30871 | |
| 30872 | /* End of SystemInitialize for SubSystem: '<S628>/Bendix_Prop2C2_Status_30' */ |
| 30873 | |
| 30874 | /* SystemInitialize for Enabled SubSystem: '<S578>/PropB_REAX_2_13' */ |
| 30875 | /* SystemInitialize for Outport: '<S580>/PropB_REAX_2_ActualHandwheelPos' */ |
| 30876 | L4_MABX_B.SFunction1_o1_gu = L4_MABX_P.PropB_REAX_2_ActualHandwheelPos; |
| 30877 | |
| 30878 | /* SystemInitialize for Outport: '<S580>/PropB_REAX_2_EchoedStrWhlPos' */ |
| 30879 | L4_MABX_B.SFunction1_o2_e2 = L4_MABX_P.PropB_REAX_2_EchoedStrWhlPos_Y0; |
| 30880 | |
| 30881 | /* SystemInitialize for Outport: '<S580>/RX status' */ |
| 30882 | L4_MABX_B.SFunction1_o3_di = L4_MABX_P.RXstatus_Y0_p; |
| 30883 | |
| 30884 | /* SystemInitialize for Outport: '<S580>/RX time' */ |
| 30885 | L4_MABX_B.SFunction1_o4_n = L4_MABX_P.RXtime_Y0_i0; |
| 30886 | |
| 30887 | /* SystemInitialize for Outport: '<S580>/RX delta time' */ |
| 30888 | L4_MABX_B.SFunction1_o5_i = L4_MABX_P.RXdeltatime_Y0_cb; |
| 30889 | |
| 30890 | /* End of SystemInitialize for SubSystem: '<S578>/PropB_REAX_2_13' */ |
| 30891 | |
| 30892 | /* SystemInitialize for Enabled SubSystem: '<S579>/PropB_REAX_2_13' */ |
| 30893 | /* SystemInitialize for Outport: '<S581>/PropB_REAX_2_ActualHandwheelPos' */ |
| 30894 | L4_MABX_B.SFunction1_o1_kg = L4_MABX_P.PropB_REAX_2_ActualHandwheelP_p; |
| 30895 | |
| 30896 | /* SystemInitialize for Outport: '<S581>/PropB_REAX_2_EchoedStrWhlPos' */ |
| 30897 | L4_MABX_B.SFunction1_o2_f2 = L4_MABX_P.PropB_REAX_2_EchoedStrWhlPos__k; |
| 30898 | |
| 30899 | /* SystemInitialize for Outport: '<S581>/RX status' */ |
| 30900 | L4_MABX_B.SFunction1_o3_mi = L4_MABX_P.RXstatus_Y0_gy; |
| 30901 | |
| 30902 | /* SystemInitialize for Outport: '<S581>/RX time' */ |
| 30903 | L4_MABX_B.SFunction1_o4_b0 = L4_MABX_P.RXtime_Y0_j; |
| 30904 | |
| 30905 | /* SystemInitialize for Outport: '<S581>/RX delta time' */ |
| 30906 | L4_MABX_B.SFunction1_o5_ej = L4_MABX_P.RXdeltatime_Y0_cs; |
| 30907 | |
| 30908 | /* End of SystemInitialize for SubSystem: '<S579>/PropB_REAX_2_13' */ |
| 30909 | |
| 30910 | /* SystemInitialize for Atomic SubSystem: '<S65>/Task_10ms' */ |
| 30911 | /* InitializeConditions for UnitDelay: '<S76>/Unit_Delay' */ |
| 30912 | L4_MABX_DW.Unit_Delay_DSTATE_fv = L4_MABX_P.Unit_Delay_InitialCondition_jn; |
| 30913 | |
| 30914 | /* InitializeConditions for UnitDelay: '<S97>/Unit Delay1' */ |
| 30915 | L4_MABX_DW.UnitDelay1_DSTATE_m = L4_MABX_P.UnitDelay1_InitialCondition; |
| 30916 | |
| 30917 | /* InitializeConditions for UnitDelay: '<S98>/Delay Input1' */ |
| 30918 | L4_MABX_DW.DelayInput1_DSTATE_d = L4_MABX_P.DetectFallNonpositive_vinit; |
| 30919 | |
| 30920 | /* InitializeConditions for UnitDelay: '<S97>/Unit Delay' */ |
| 30921 | L4_MABX_DW.UnitDelay_DSTATE_b1 = L4_MABX_P.UnitDelay_InitialCondition_br; |
| 30922 | |
| 30923 | /* InitializeConditions for RateTransition: '<S81>/TmpRTBAtSignal Conversion1Inport1' */ |
| 30924 | L4_MABX_DW.TmpRTBAtSignalConversion1Inport = |
| 30925 | L4_MABX_P.TmpRTBAtSignalConversion1Inport; |
| 30926 | |
| 30927 | /* InitializeConditions for UnitDelay: '<S389>/Unit_Delay' */ |
| 30928 | L4_MABX_DW.Unit_Delay_DSTATE_cx = L4_MABX_P.Unit_Delay_InitialCondition_b1; |
| 30929 | |
| 30930 | /* InitializeConditions for UnitDelay: '<S390>/Unit_Delay' */ |
| 30931 | L4_MABX_DW.Unit_Delay_DSTATE_d0 = L4_MABX_P.Unit_Delay_InitialCondition_g; |
| 30932 | |
| 30933 | /* InitializeConditions for UnitDelay: '<S347>/Unit_Delay' */ |
| 30934 | L4_MABX_DW.Unit_Delay_DSTATE_e = L4_MABX_P.Unit_Delay_InitialCondition_i; |
| 30935 | |
| 30936 | /* InitializeConditions for UnitDelay: '<S394>/FixPt Unit Delay2' */ |
| 30937 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_a = |
| 30938 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_f5; |
| 30939 | |
| 30940 | /* InitializeConditions for UnitDelay: '<S394>/FixPt Unit Delay1' */ |
| 30941 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_hj = |
| 30942 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_l; |
| 30943 | |
| 30944 | /* InitializeConditions for UnitDelay: '<S391>/Unit_Delay' */ |
| 30945 | L4_MABX_DW.Unit_Delay_DSTATE_m = L4_MABX_P.Unit_Delay_InitialCondition_hae; |
| 30946 | |
| 30947 | /* InitializeConditions for UnitDelay: '<S378>/Unit_Delay' */ |
| 30948 | L4_MABX_DW.Unit_Delay_DSTATE_iy = L4_MABX_P.Unit_Delay_InitialCondition_aw; |
| 30949 | |
| 30950 | /* InitializeConditions for UnitDelay: '<S379>/Unit_Delay' */ |
| 30951 | L4_MABX_DW.Unit_Delay_DSTATE_mv = L4_MABX_P.Unit_Delay_InitialCondition_gt; |
| 30952 | |
| 30953 | /* InitializeConditions for UnitDelay: '<S345>/Unit_Delay' */ |
| 30954 | L4_MABX_DW.Unit_Delay_DSTATE_g = L4_MABX_P.Unit_Delay_InitialCondition_fb; |
| 30955 | |
| 30956 | /* InitializeConditions for UnitDelay: '<S383>/FixPt Unit Delay2' */ |
| 30957 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_i = |
| 30958 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_po; |
| 30959 | |
| 30960 | /* InitializeConditions for UnitDelay: '<S383>/FixPt Unit Delay1' */ |
| 30961 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_hq = |
| 30962 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_d; |
| 30963 | |
| 30964 | /* InitializeConditions for UnitDelay: '<S380>/Unit_Delay' */ |
| 30965 | L4_MABX_DW.Unit_Delay_DSTATE_b = L4_MABX_P.Unit_Delay_InitialCondition_c; |
| 30966 | |
| 30967 | /* InitializeConditions for RateTransition: '<S81>/TmpRTBAtSignal Conversion3Inport1' */ |
| 30968 | L4_MABX_DW.TmpRTBAtSignalConversion3Inport = |
| 30969 | L4_MABX_P.TmpRTBAtSignalConversion3Inport; |
| 30970 | |
| 30971 | /* InitializeConditions for RateTransition: '<S81>/TmpRTBAtSignal Conversion2Inport1' */ |
| 30972 | L4_MABX_DW.TmpRTBAtSignalConversion2Inport = |
| 30973 | L4_MABX_P.TmpRTBAtSignalConversion2Inport; |
| 30974 | |
| 30975 | /* InitializeConditions for UnitDelay: '<S360>/Unit_Delay' */ |
| 30976 | L4_MABX_DW.Unit_Delay_DSTATE_bw = L4_MABX_P.Unit_Delay_InitialCondition_e; |
| 30977 | |
| 30978 | /* InitializeConditions for UnitDelay: '<S362>/Unit_Delay' */ |
| 30979 | L4_MABX_DW.Unit_Delay_DSTATE_ko = L4_MABX_P.Unit_Delay_InitialCondition_ml; |
| 30980 | |
| 30981 | /* InitializeConditions for UnitDelay: '<S371>/FixPt Unit Delay2' */ |
| 30982 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_f = |
| 30983 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_i; |
| 30984 | |
| 30985 | /* InitializeConditions for UnitDelay: '<S371>/FixPt Unit Delay1' */ |
| 30986 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_l = |
| 30987 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_h; |
| 30988 | |
| 30989 | /* InitializeConditions for UnitDelay: '<S369>/Unit_Delay' */ |
| 30990 | L4_MABX_DW.Unit_Delay_DSTATE_p = L4_MABX_P.Unit_Delay_InitialCondition_j; |
| 30991 | |
| 30992 | /* InitializeConditions for UnitDelay: '<S342>/Delay Input1' */ |
| 30993 | L4_MABX_DW.DelayInput1_DSTATE[0] = L4_MABX_P.DetectChange1_vinit; |
| 30994 | |
| 30995 | /* InitializeConditions for UnitDelay: '<S349>/Delay Input1' */ |
| 30996 | L4_MABX_DW.DelayInput1_DSTATE_f[0] = L4_MABX_P.DetectChange1_vinit_n; |
| 30997 | |
| 30998 | /* InitializeConditions for UnitDelay: '<S342>/Delay Input1' */ |
| 30999 | L4_MABX_DW.DelayInput1_DSTATE[1] = L4_MABX_P.DetectChange1_vinit; |
| 31000 | |
| 31001 | /* InitializeConditions for UnitDelay: '<S349>/Delay Input1' */ |
| 31002 | L4_MABX_DW.DelayInput1_DSTATE_f[1] = L4_MABX_P.DetectChange1_vinit_n; |
| 31003 | |
| 31004 | /* InitializeConditions for UnitDelay: '<S351>/Unit_Delay' */ |
| 31005 | L4_MABX_DW.Unit_Delay_DSTATE_la = L4_MABX_P.Unit_Delay_InitialCondition_ag; |
| 31006 | |
| 31007 | /* InitializeConditions for UnitDelay: '<S355>/FixPt Unit Delay2' */ |
| 31008 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_c = |
| 31009 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_ck; |
| 31010 | |
| 31011 | /* InitializeConditions for UnitDelay: '<S355>/FixPt Unit Delay1' */ |
| 31012 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_e = |
| 31013 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_m; |
| 31014 | |
| 31015 | /* InitializeConditions for UnitDelay: '<S350>/Unit_Delay' */ |
| 31016 | L4_MABX_DW.Unit_Delay_1_DSTATE_j = L4_MABX_P.Unit_Delay_1_InitialCondition; |
| 31017 | L4_MABX_DW.Unit_Delay_2_DSTATE_e = L4_MABX_P.Unit_Delay_2_InitialCondition; |
| 31018 | L4_MABX_DW.Unit_Delay_3_DSTATE_j = L4_MABX_P.Unit_Delay_3_InitialCondition; |
| 31019 | |
| 31020 | /* InitializeConditions for UnitDelay: '<S348>/Unit_Delay' */ |
| 31021 | L4_MABX_DW.Unit_Delay_DSTATE_ff = L4_MABX_P.Unit_Delay_InitialCondition_e2; |
| 31022 | |
| 31023 | /* InitializeConditions for UnitDelay: '<S107>/Unit_Delay' */ |
| 31024 | L4_MABX_DW.Unit_Delay_DSTATE_eu4 = L4_MABX_P.Unit_Delay_InitialCondition_ip; |
| 31025 | |
| 31026 | /* InitializeConditions for UnitDelay: '<S203>/Unit_Delay1' */ |
| 31027 | L4_MABX_DW.Unit_Delay1_DSTATE_di = L4_MABX_P.Unit_Delay1_InitialCondition_f; |
| 31028 | |
| 31029 | /* InitializeConditions for UnitDelay: '<S203>/Unit_Delay2' */ |
| 31030 | L4_MABX_DW.Unit_Delay2_DSTATE_e = L4_MABX_P.Unit_Delay2_InitialCondition_a; |
| 31031 | |
| 31032 | /* InitializeConditions for UnitDelay: '<S202>/UD' */ |
| 31033 | L4_MABX_DW.UD_DSTATE = L4_MABX_P.DiscreteDerivative1_ICPrevScale; |
| 31034 | |
| 31035 | /* InitializeConditions for UnitDelay: '<S327>/Unit_Delay1' */ |
| 31036 | L4_MABX_DW.Unit_Delay1_DSTATE_db = L4_MABX_P.Unit_Delay1_InitialCondition_m; |
| 31037 | |
| 31038 | /* InitializeConditions for UnitDelay: '<S327>/Unit_Delay2' */ |
| 31039 | L4_MABX_DW.Unit_Delay2_DSTATE_d = L4_MABX_P.Unit_Delay2_InitialCondition_g; |
| 31040 | |
| 31041 | /* InitializeConditions for UnitDelay: '<S326>/Delay Input1' */ |
| 31042 | L4_MABX_DW.DelayInput1_DSTATE_f0 = L4_MABX_P.DetectChange_vinit; |
| 31043 | |
| 31044 | /* InitializeConditions for UnitDelay: '<S328>/Unit_Delay1' */ |
| 31045 | L4_MABX_DW.Unit_Delay1_DSTATE_as = L4_MABX_P.Unit_Delay1_InitialCondition_ps; |
| 31046 | |
| 31047 | /* InitializeConditions for UnitDelay: '<S328>/Unit_Delay2' */ |
| 31048 | L4_MABX_DW.Unit_Delay2_DSTATE_i = L4_MABX_P.Unit_Delay2_InitialCondition_ji; |
| 31049 | |
| 31050 | /* InitializeConditions for UnitDelay: '<S329>/Unit_Delay1' */ |
| 31051 | L4_MABX_DW.Unit_Delay1_DSTATE_p = L4_MABX_P.Unit_Delay1_InitialCondition_j; |
| 31052 | |
| 31053 | /* InitializeConditions for UnitDelay: '<S329>/Unit_Delay2' */ |
| 31054 | L4_MABX_DW.Unit_Delay2_DSTATE_p = L4_MABX_P.Unit_Delay2_InitialCondition_ap; |
| 31055 | |
| 31056 | /* InitializeConditions for UnitDelay: '<S285>/Unit Delay' */ |
| 31057 | L4_MABX_DW.UnitDelay_DSTATE_dj = L4_MABX_P.UnitDelay_InitialCondition_c; |
| 31058 | |
| 31059 | /* InitializeConditions for UnitDelay: '<S295>/Unit Delay' */ |
| 31060 | L4_MABX_DW.UnitDelay_DSTATE_m = L4_MABX_P.UnitDelay_InitialCondition; |
| 31061 | |
| 31062 | /* InitializeConditions for UnitDelay: '<S296>/Unit Delay' */ |
| 31063 | L4_MABX_DW.UnitDelay_DSTATE_m0 = L4_MABX_P.UnitDelay_InitialCondition_g; |
| 31064 | |
| 31065 | /* InitializeConditions for UnitDelay: '<S296>/Unit Delay1' */ |
| 31066 | L4_MABX_DW.UnitDelay1_DSTATE_k = L4_MABX_P.UnitDelay1_InitialCondition_j; |
| 31067 | |
| 31068 | /* InitializeConditions for RateTransition: '<S80>/TmpRTBAtrad2deg1Inport1' */ |
| 31069 | L4_MABX_DW.TmpRTBAtrad2deg1Inport1_Buffer0 = |
| 31070 | L4_MABX_P.TmpRTBAtrad2deg1Inport1_Initial; |
| 31071 | |
| 31072 | /* InitializeConditions for RateTransition: '<S80>/TmpRTBAtsignCurveOffsetInport1' */ |
| 31073 | L4_MABX_DW.TmpRTBAtsignCurveOffsetInport1_ = |
| 31074 | L4_MABX_P.TmpRTBAtsignCurveOffsetInport1_; |
| 31075 | |
| 31076 | /* InitializeConditions for UnitDelay: '<S290>/Unit Delay' */ |
| 31077 | L4_MABX_DW.UnitDelay_DSTATE_m1 = L4_MABX_P.UnitDelay_InitialCondition_eo; |
| 31078 | |
| 31079 | /* InitializeConditions for RateTransition: '<S284>/TmpRTBAtAdd2Inport2' */ |
| 31080 | L4_MABX_DW.TmpRTBAtAdd2Inport2_Buffer0 = |
| 31081 | L4_MABX_P.TmpRTBAtAdd2Inport2_InitialCond; |
| 31082 | |
| 31083 | /* InitializeConditions for UnitDelay: '<S308>/Delay Input2' */ |
| 31084 | L4_MABX_DW.DelayInput2_DSTATE = L4_MABX_P.DelayInput2_InitialCondition; |
| 31085 | |
| 31086 | /* InitializeConditions for DiscreteIntegrator: '<S307>/Integrator' */ |
| 31087 | L4_MABX_DW.Integrator_DSTATE = L4_MABX_P.Integrator_IC; |
| 31088 | L4_MABX_DW.Integrator_PrevResetState = 2; |
| 31089 | |
| 31090 | /* InitializeConditions for DiscreteIntegrator: '<S307>/Filter' */ |
| 31091 | L4_MABX_DW.Filter_DSTATE = L4_MABX_P.Filter_IC; |
| 31092 | L4_MABX_DW.Filter_PrevResetState = 2; |
| 31093 | |
| 31094 | /* InitializeConditions for UnitDelay: '<S311>/Delay Input' */ |
| 31095 | L4_MABX_DW.DelayInput_DSTATE = L4_MABX_P.TransferFcnLeadorLag_ICPrevInpu; |
| 31096 | |
| 31097 | /* InitializeConditions for UnitDelay: '<S311>/Delay Output' */ |
| 31098 | L4_MABX_DW.DelayOutput_DSTATE = L4_MABX_P.TransferFcnLeadorLag_ICPrevOutp; |
| 31099 | |
| 31100 | /* InitializeConditions for UnitDelay: '<S309>/Delay Input2' */ |
| 31101 | L4_MABX_DW.DelayInput2_DSTATE_a = L4_MABX_P.DelayInput2_InitialCondition_m; |
| 31102 | |
| 31103 | /* InitializeConditions for DiscreteIntegrator: '<S301>/Discrete-Time Integrator' */ |
| 31104 | L4_MABX_DW.DiscreteTimeIntegrator_IC_LOADI = 1U; |
| 31105 | L4_MABX_DW.DiscreteTimeIntegrator_PrevRese = 2; |
| 31106 | |
| 31107 | /* InitializeConditions for UnitDelay: '<S321>/Delay Input2' */ |
| 31108 | L4_MABX_DW.DelayInput2_DSTATE_l = L4_MABX_P.DelayInput2_InitialCondition_g; |
| 31109 | |
| 31110 | /* InitializeConditions for DiscreteIntegrator: '<S80>/Discrete-Time Integrator' */ |
| 31111 | L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e = |
| 31112 | L4_MABX_P.DiscreteTimeIntegrator_IC; |
| 31113 | L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e = 0; |
| 31114 | |
| 31115 | /* InitializeConditions for RateLimiter: '<S310>/Limit Rate Limiter' */ |
| 31116 | L4_MABX_DW.PrevY = L4_MABX_P.LimitRateLimiter_IC; |
| 31117 | |
| 31118 | /* InitializeConditions for UnitDelay: '<S80>/Unit Delay' */ |
| 31119 | L4_MABX_DW.UnitDelay_DSTATE_e3 = L4_MABX_P.UnitDelay_InitialCondition_g1; |
| 31120 | |
| 31121 | /* InitializeConditions for UnitDelay: '<S373>/FixPt Unit Delay2' */ |
| 31122 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_aw = |
| 31123 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_g; |
| 31124 | |
| 31125 | /* InitializeConditions for UnitDelay: '<S373>/FixPt Unit Delay1' */ |
| 31126 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_pe = |
| 31127 | L4_MABX_P.FixPtUnitDelay1_InitialCondi_dl; |
| 31128 | |
| 31129 | /* InitializeConditions for UnitDelay: '<S374>/FixPt Unit Delay2' */ |
| 31130 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_gx = |
| 31131 | L4_MABX_P.FixPtUnitDelay2_InitialCondi_pz; |
| 31132 | |
| 31133 | /* InitializeConditions for UnitDelay: '<S374>/FixPt Unit Delay1' */ |
| 31134 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g0 = |
| 31135 | L4_MABX_P.FixPtUnitDelay1_InitialCondi_ol; |
| 31136 | |
| 31137 | /* InitializeConditions for UnitDelay: '<S368>/Unit_Delay' */ |
| 31138 | L4_MABX_DW.Unit_Delay_DSTATE_j = L4_MABX_P.Unit_Delay_InitialCondition_b; |
| 31139 | |
| 31140 | /* SystemInitialize for Enabled SubSystem: '<S79>/Throttle_controller_gov' */ |
| 31141 | /* InitializeConditions for UnitDelay: '<S220>/Unit_Delay1' */ |
| 31142 | L4_MABX_DW.Unit_Delay1_DSTATE_p1 = L4_MABX_P.Unit_Delay1_InitialCondition_o; |
| 31143 | |
| 31144 | /* InitializeConditions for UnitDelay: '<S220>/Unit_Delay' */ |
| 31145 | L4_MABX_DW.Unit_Delay_DSTATE_lqi = L4_MABX_P.Unit_Delay_InitialCondition_b2; |
| 31146 | |
| 31147 | /* InitializeConditions for UnitDelay: '<S247>/Unit_Delay' */ |
| 31148 | L4_MABX_DW.Unit_Delay_DSTATE_be = L4_MABX_P.Unit_Delay_InitialCondition_lj; |
| 31149 | |
| 31150 | /* InitializeConditions for UnitDelay: '<S267>/Unit_Delay1' */ |
| 31151 | L4_MABX_DW.Unit_Delay1_DSTATE_h = L4_MABX_P.Unit_Delay1_InitialCondition_a; |
| 31152 | |
| 31153 | /* InitializeConditions for UnitDelay: '<S268>/Unit_Delay' */ |
| 31154 | L4_MABX_DW.Unit_Delay_DSTATE_fi = L4_MABX_P.Unit_Delay_InitialCondition_bm; |
| 31155 | |
| 31156 | /* InitializeConditions for UnitDelay: '<S272>/FixPt Unit Delay2' */ |
| 31157 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_gq = |
| 31158 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_a; |
| 31159 | |
| 31160 | /* InitializeConditions for UnitDelay: '<S272>/FixPt Unit Delay1' */ |
| 31161 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_a = |
| 31162 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_o; |
| 31163 | |
| 31164 | /* InitializeConditions for UnitDelay: '<S267>/Unit_Delay2' */ |
| 31165 | L4_MABX_DW.Unit_Delay2_DSTATE_mh = L4_MABX_P.Unit_Delay2_InitialCondition_j; |
| 31166 | |
| 31167 | /* InitializeConditions for UnitDelay: '<S222>/Unit_Delay' */ |
| 31168 | L4_MABX_DW.Unit_Delay_DSTATE_fz = L4_MABX_P.Unit_Delay_InitialCondition_kg; |
| 31169 | |
| 31170 | /* SystemInitialize for Enabled SubSystem: '<S244>/Calculate_D_term' */ |
| 31171 | L4_MA_Calculate_D_term_Init(&L4_MABX_B.Calculate_D_term_h, |
| 31172 | &L4_MABX_DW.Calculate_D_term_h, &L4_MABX_P.Calculate_D_term_h); |
| 31173 | |
| 31174 | /* End of SystemInitialize for SubSystem: '<S244>/Calculate_D_term' */ |
| 31175 | |
| 31176 | /* SystemInitialize for Enabled SubSystem: '<S244>/Calculate_I_term' */ |
| 31177 | L4_MA_Calculate_I_term_Init(&L4_MABX_B.Calculate_I_term_n, |
| 31178 | &L4_MABX_DW.Calculate_I_term_n, &L4_MABX_P.Calculate_I_term_n); |
| 31179 | |
| 31180 | /* End of SystemInitialize for SubSystem: '<S244>/Calculate_I_term' */ |
| 31181 | |
| 31182 | /* SystemInitialize for Outport: '<S212>/PID_output' */ |
| 31183 | L4_MABX_B.If_Then_Else_pi.Switch = L4_MABX_P.PID_output_Y0_c; |
| 31184 | |
| 31185 | /* SystemInitialize for Outport: '<S212>/PID_output_unlim' */ |
| 31186 | L4_MABX_B.Add_ds = L4_MABX_P.PID_output_unlim_Y0; |
| 31187 | |
| 31188 | /* SystemInitialize for Outport: '<S212>/PID_control_error' */ |
| 31189 | L4_MABX_B.If_Then_Else_k2t.Switch = L4_MABX_P.PID_control_error_Y0; |
| 31190 | |
| 31191 | /* SystemInitialize for Outport: '<S212>/PID_p_term' */ |
| 31192 | L4_MABX_B.Product_i = L4_MABX_P.PID_p_term_Y0; |
| 31193 | |
| 31194 | /* SystemInitialize for Outport: '<S212>/PID_i_term' */ |
| 31195 | L4_MABX_B.PID_i_term_c = L4_MABX_P.PID_i_term_Y0; |
| 31196 | |
| 31197 | /* SystemInitialize for Outport: '<S212>/PID_d_term' */ |
| 31198 | L4_MABX_B.PID_d_term_c = L4_MABX_P.PID_d_term_Y0; |
| 31199 | |
| 31200 | /* SystemInitialize for Outport: '<S212>/PID_hold_i_term_f' */ |
| 31201 | L4_MABX_B.PID_hold_i_term_f_b = L4_MABX_P.PID_hold_i_term_f_Y0; |
| 31202 | |
| 31203 | /* End of SystemInitialize for SubSystem: '<S79>/Throttle_controller_gov' */ |
| 31204 | |
| 31205 | /* SystemInitialize for Enabled SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */ |
| 31206 | /* InitializeConditions for UnitDelay: '<S184>/Unit_Delay' */ |
| 31207 | L4_MABX_DW.Unit_Delay_DSTATE_o = L4_MABX_P.Unit_Delay_InitialCondition_l; |
| 31208 | |
| 31209 | /* InitializeConditions for UnitDelay: '<S194>/Unit_Delay' */ |
| 31210 | L4_MABX_DW.Unit_Delay_DSTATE_a = L4_MABX_P.Unit_Delay_InitialCondition_cl; |
| 31211 | |
| 31212 | /* InitializeConditions for UnitDelay: '<S198>/FixPt Unit Delay2' */ |
| 31213 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_l = |
| 31214 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_f; |
| 31215 | |
| 31216 | /* InitializeConditions for UnitDelay: '<S198>/FixPt Unit Delay1' */ |
| 31217 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_d = |
| 31218 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_j; |
| 31219 | |
| 31220 | /* InitializeConditions for UnitDelay: '<S195>/Unit_Delay' */ |
| 31221 | L4_MABX_DW.Unit_Delay_DSTATE_om = L4_MABX_P.Unit_Delay_InitialCondition_ha; |
| 31222 | |
| 31223 | /* SystemInitialize for Outport: '<S184>/Shift_interlock_brake_press_target_kpa' */ |
| 31224 | L4_MABX_B.If_Then_Else_il.Switch = L4_MABX_P.Shift_interlock_brake_press_tar; |
| 31225 | |
| 31226 | /* SystemInitialize for Outport: '<S184>/F_Shift_interlock_conditions_met' */ |
| 31227 | L4_MABX_B.F_Shift_interlock_conditions_me = |
| 31228 | L4_MABX_P.F_Shift_interlock_conditions_me; |
| 31229 | |
| 31230 | /* End of SystemInitialize for SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */ |
| 31231 | |
| 31232 | /* SystemInitialize for Enabled SubSystem: '<S105>/Determine_brake_hold_pressure_target' */ |
| 31233 | /* InitializeConditions for UnitDelay: '<S183>/Unit_Delay' */ |
| 31234 | L4_MABX_DW.Unit_Delay_DSTATE_c = L4_MABX_P.Unit_Delay_InitialCondition_d; |
| 31235 | |
| 31236 | /* InitializeConditions for UnitDelay: '<S187>/Unit_Delay' */ |
| 31237 | L4_MABX_DW.Unit_Delay_DSTATE_or = L4_MABX_P.Unit_Delay_InitialCondition_fy; |
| 31238 | |
| 31239 | /* InitializeConditions for UnitDelay: '<S191>/FixPt Unit Delay2' */ |
| 31240 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_je = |
| 31241 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_e; |
| 31242 | |
| 31243 | /* InitializeConditions for UnitDelay: '<S191>/FixPt Unit Delay1' */ |
| 31244 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_b = |
| 31245 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_p; |
| 31246 | |
| 31247 | /* InitializeConditions for UnitDelay: '<S188>/Unit_Delay' */ |
| 31248 | L4_MABX_DW.Unit_Delay_DSTATE_oj = L4_MABX_P.Unit_Delay_InitialCondition_k; |
| 31249 | |
| 31250 | /* SystemInitialize for Outport: '<S183>/Brake_hold_brake_press_target_kpa' */ |
| 31251 | L4_MABX_B.If_Then_Else_gj.Switch = L4_MABX_P.Brake_hold_brake_press_target_k; |
| 31252 | |
| 31253 | /* SystemInitialize for Outport: '<S183>/F_Brake_hold_conditions_met' */ |
| 31254 | L4_MABX_B.F_Brake_hold_conditions_met = |
| 31255 | L4_MABX_P.F_Brake_hold_conditions_met_Y0; |
| 31256 | |
| 31257 | /* End of SystemInitialize for SubSystem: '<S105>/Determine_brake_hold_pressure_target' */ |
| 31258 | |
| 31259 | /* SystemInitialize for Enabled SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */ |
| 31260 | /* InitializeConditions for UnitDelay: '<S111>/Unit_Delay' */ |
| 31261 | L4_MABX_DW.Unit_Delay_DSTATE_d = L4_MABX_P.Unit_Delay_InitialCondition; |
| 31262 | |
| 31263 | /* InitializeConditions for UnitDelay: '<S115>/Unit_Delay' */ |
| 31264 | L4_MABX_DW.Unit_Delay_DSTATE_omj = L4_MABX_P.Unit_Delay_InitialCondition_lt; |
| 31265 | |
| 31266 | /* InitializeConditions for UnitDelay: '<S135>/Unit_Delay1' */ |
| 31267 | L4_MABX_DW.Unit_Delay1_DSTATE_b = L4_MABX_P.Unit_Delay1_InitialCondition; |
| 31268 | |
| 31269 | /* InitializeConditions for UnitDelay: '<S136>/Unit_Delay' */ |
| 31270 | L4_MABX_DW.Unit_Delay_DSTATE_h4 = L4_MABX_P.Unit_Delay_InitialCondition_og; |
| 31271 | |
| 31272 | /* InitializeConditions for UnitDelay: '<S140>/FixPt Unit Delay2' */ |
| 31273 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_gm = |
| 31274 | L4_MABX_P.FixPtUnitDelay2_InitialConditio; |
| 31275 | |
| 31276 | /* InitializeConditions for UnitDelay: '<S140>/FixPt Unit Delay1' */ |
| 31277 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g1 = |
| 31278 | L4_MABX_P.FixPtUnitDelay1_InitialConditio; |
| 31279 | |
| 31280 | /* InitializeConditions for UnitDelay: '<S135>/Unit_Delay2' */ |
| 31281 | L4_MABX_DW.Unit_Delay2_DSTATE_dy = L4_MABX_P.Unit_Delay2_InitialCondition; |
| 31282 | |
| 31283 | /* InitializeConditions for UnitDelay: '<S110>/Unit_Delay' */ |
| 31284 | L4_MABX_DW.Unit_Delay_DSTATE_i = L4_MABX_P.Unit_Delay_InitialCondition_p; |
| 31285 | |
| 31286 | /* SystemInitialize for Enabled SubSystem: '<S112>/Calculate_D_term' */ |
| 31287 | L4_MA_Calculate_D_term_Init(&L4_MABX_B.Calculate_D_term, |
| 31288 | &L4_MABX_DW.Calculate_D_term, &L4_MABX_P.Calculate_D_term); |
| 31289 | |
| 31290 | /* End of SystemInitialize for SubSystem: '<S112>/Calculate_D_term' */ |
| 31291 | |
| 31292 | /* SystemInitialize for Enabled SubSystem: '<S112>/Calculate_I_term' */ |
| 31293 | L4_MA_Calculate_I_term_Init(&L4_MABX_B.Calculate_I_term, |
| 31294 | &L4_MABX_DW.Calculate_I_term, &L4_MABX_P.Calculate_I_term); |
| 31295 | |
| 31296 | /* End of SystemInitialize for SubSystem: '<S112>/Calculate_I_term' */ |
| 31297 | |
| 31298 | /* SystemInitialize for Outport: '<S102>/PID_output' */ |
| 31299 | L4_MABX_B.If_Then_Else_n.Switch = L4_MABX_P.PID_output_Y0; |
| 31300 | |
| 31301 | /* End of SystemInitialize for SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */ |
| 31302 | |
| 31303 | /* SystemInitialize for Chart: '<S344>/VehicleSpeedSetpointDynamicCalculation' */ |
| 31304 | L4_MABX_B.TimeVectorRaw[0] = 0.0; |
| 31305 | L4_MABX_B.TimeVectorRaw[1] = 0.001; |
| 31306 | L4_MABX_B.TimeVectorRaw[2] = 0.002; |
| 31307 | L4_MABX_B.TimeVectorRaw[3] = 0.003; |
| 31308 | L4_MABX_B.TimeVectorRaw[4] = 0.004; |
| 31309 | L4_MABX_B.TimeVectorRaw[5] = 0.005; |
| 31310 | L4_MABX_B.PositionVectorRaw[0] = 0.0; |
| 31311 | L4_MABX_B.PositionVectorRaw[1] = 0.001; |
| 31312 | L4_MABX_B.PositionVectorRaw[2] = 0.002; |
| 31313 | L4_MABX_B.PositionVectorRaw[3] = 0.003; |
| 31314 | L4_MABX_B.PositionVectorRaw[4] = 0.004; |
| 31315 | L4_MABX_B.PositionVectorRaw[5] = 0.005; |
| 31316 | for (i = 0; i < 6; i++) { |
| 31317 | L4_MABX_B.VelocityVectorRaw[i] = 0.0; |
| 31318 | L4_MABX_B.AccelerationVectorRaw[i] = 0.0; |
| 31319 | L4_MABX_B.JerkVectorRaw[i] = 0.0; |
| 31320 | } |
| 31321 | |
| 31322 | /* End of SystemInitialize for Chart: '<S344>/VehicleSpeedSetpointDynamicCalculation' */ |
| 31323 | |
| 31324 | /* SystemInitialize for Chart: '<S344>/TwentyPointVectorCalculation' */ |
| 31325 | L4_MABX_B.TimeVector[0] = 0.0; |
| 31326 | L4_MABX_B.TimeVector[1] = 0.001; |
| 31327 | L4_MABX_B.TimeVector[2] = 0.002; |
| 31328 | L4_MABX_B.TimeVector[3] = 0.003; |
| 31329 | L4_MABX_B.TimeVector[4] = 0.004; |
| 31330 | L4_MABX_B.TimeVector[5] = 0.005; |
| 31331 | L4_MABX_B.TimeVector[6] = 0.006; |
| 31332 | L4_MABX_B.TimeVector[7] = 0.007; |
| 31333 | L4_MABX_B.TimeVector[8] = 0.008; |
| 31334 | L4_MABX_B.TimeVector[9] = 0.0090000000000000011; |
| 31335 | L4_MABX_B.TimeVector[10] = 0.01; |
| 31336 | L4_MABX_B.TimeVector[11] = 0.011; |
| 31337 | L4_MABX_B.TimeVector[12] = 0.012; |
| 31338 | L4_MABX_B.TimeVector[13] = 0.013000000000000001; |
| 31339 | L4_MABX_B.TimeVector[14] = 0.014; |
| 31340 | L4_MABX_B.TimeVector[15] = 0.015; |
| 31341 | L4_MABX_B.TimeVector[16] = 0.016; |
| 31342 | L4_MABX_B.TimeVector[17] = 0.017; |
| 31343 | L4_MABX_B.TimeVector[18] = 0.018000000000000002; |
| 31344 | L4_MABX_B.TimeVector[19] = 0.019; |
| 31345 | L4_MABX_B.TimeVector[20] = 0.02; |
| 31346 | L4_MABX_B.TimeVector[21] = 0.021; |
| 31347 | L4_MABX_B.TimeVector[22] = 0.022; |
| 31348 | L4_MABX_B.TimeVector[23] = 0.023; |
| 31349 | L4_MABX_B.TimeVector[24] = 0.024; |
| 31350 | L4_MABX_B.TimeVector[25] = 0.025; |
| 31351 | L4_MABX_B.TimeVector[26] = 0.026000000000000002; |
| 31352 | L4_MABX_B.TimeVector[27] = 0.027; |
| 31353 | L4_MABX_B.TimeVector[28] = 0.028; |
| 31354 | L4_MABX_B.TimeVector[29] = 0.029; |
| 31355 | L4_MABX_B.TimeVector[30] = 0.03; |
| 31356 | L4_MABX_B.TimeVector[31] = 0.031; |
| 31357 | L4_MABX_B.TimeVector[32] = 0.032; |
| 31358 | L4_MABX_B.PositionVector[0] = 0.0; |
| 31359 | L4_MABX_B.PositionVector[1] = 0.001; |
| 31360 | L4_MABX_B.PositionVector[2] = 0.002; |
| 31361 | L4_MABX_B.PositionVector[3] = 0.003; |
| 31362 | L4_MABX_B.PositionVector[4] = 0.004; |
| 31363 | L4_MABX_B.PositionVector[5] = 0.005; |
| 31364 | L4_MABX_B.PositionVector[6] = 0.006; |
| 31365 | L4_MABX_B.PositionVector[7] = 0.007; |
| 31366 | L4_MABX_B.PositionVector[8] = 0.008; |
| 31367 | L4_MABX_B.PositionVector[9] = 0.0090000000000000011; |
| 31368 | L4_MABX_B.PositionVector[10] = 0.01; |
| 31369 | L4_MABX_B.PositionVector[11] = 0.011; |
| 31370 | L4_MABX_B.PositionVector[12] = 0.012; |
| 31371 | L4_MABX_B.PositionVector[13] = 0.013000000000000001; |
| 31372 | L4_MABX_B.PositionVector[14] = 0.014; |
| 31373 | L4_MABX_B.PositionVector[15] = 0.015; |
| 31374 | L4_MABX_B.PositionVector[16] = 0.016; |
| 31375 | L4_MABX_B.PositionVector[17] = 0.017; |
| 31376 | L4_MABX_B.PositionVector[18] = 0.018000000000000002; |
| 31377 | L4_MABX_B.PositionVector[19] = 0.019; |
| 31378 | L4_MABX_B.PositionVector[20] = 0.02; |
| 31379 | L4_MABX_B.PositionVector[21] = 0.021; |
| 31380 | L4_MABX_B.PositionVector[22] = 0.022; |
| 31381 | L4_MABX_B.PositionVector[23] = 0.023; |
| 31382 | L4_MABX_B.PositionVector[24] = 0.024; |
| 31383 | L4_MABX_B.PositionVector[25] = 0.025; |
| 31384 | L4_MABX_B.PositionVector[26] = 0.026000000000000002; |
| 31385 | L4_MABX_B.PositionVector[27] = 0.027; |
| 31386 | L4_MABX_B.PositionVector[28] = 0.028; |
| 31387 | L4_MABX_B.PositionVector[29] = 0.029; |
| 31388 | L4_MABX_B.PositionVector[30] = 0.03; |
| 31389 | L4_MABX_B.PositionVector[31] = 0.031; |
| 31390 | L4_MABX_B.PositionVector[32] = 0.032; |
| 31391 | memset(&L4_MABX_B.VelocityVector[0], 0, 33U * sizeof(real_T)); |
| 31392 | memset(&L4_MABX_B.AccelerationVector[0], 0, 33U * sizeof(real_T)); |
| 31393 | memset(&L4_MABX_B.JerkVector[0], 0, 33U * sizeof(real_T)); |
| 31394 | |
| 31395 | /* SystemInitialize for Enabled SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */ |
| 31396 | /* InitializeConditions for UnitDelay: '<S146>/Unit_Delay' */ |
| 31397 | L4_MABX_DW.Unit_Delay_DSTATE_eu = L4_MABX_P.Unit_Delay_InitialCondition_f; |
| 31398 | |
| 31399 | /* InitializeConditions for UnitDelay: '<S153>/Unit_Delay' */ |
| 31400 | L4_MABX_DW.Unit_Delay_DSTATE_nw = L4_MABX_P.Unit_Delay_InitialCondition_jb; |
| 31401 | |
| 31402 | /* InitializeConditions for UnitDelay: '<S173>/Unit_Delay1' */ |
| 31403 | L4_MABX_DW.Unit_Delay1_DSTATE_f = L4_MABX_P.Unit_Delay1_InitialCondition_p; |
| 31404 | |
| 31405 | /* InitializeConditions for UnitDelay: '<S174>/Unit_Delay' */ |
| 31406 | L4_MABX_DW.Unit_Delay_DSTATE_g4 = L4_MABX_P.Unit_Delay_InitialCondition_lq; |
| 31407 | |
| 31408 | /* InitializeConditions for UnitDelay: '<S178>/FixPt Unit Delay2' */ |
| 31409 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_o4 = |
| 31410 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_p; |
| 31411 | |
| 31412 | /* InitializeConditions for UnitDelay: '<S178>/FixPt Unit Delay1' */ |
| 31413 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_g2 = |
| 31414 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_b; |
| 31415 | |
| 31416 | /* InitializeConditions for UnitDelay: '<S173>/Unit_Delay2' */ |
| 31417 | L4_MABX_DW.Unit_Delay2_DSTATE_c = L4_MABX_P.Unit_Delay2_InitialCondition_b; |
| 31418 | |
| 31419 | /* InitializeConditions for UnitDelay: '<S145>/Unit_Delay' */ |
| 31420 | L4_MABX_DW.Unit_Delay_DSTATE_h = L4_MABX_P.Unit_Delay_InitialCondition_h; |
| 31421 | |
| 31422 | /* SystemInitialize for Enabled SubSystem: '<S150>/Calculate_D_term' */ |
| 31423 | L4_MA_Calculate_D_term_Init(&L4_MABX_B.Calculate_D_term_p, |
| 31424 | &L4_MABX_DW.Calculate_D_term_p, &L4_MABX_P.Calculate_D_term_p); |
| 31425 | |
| 31426 | /* End of SystemInitialize for SubSystem: '<S150>/Calculate_D_term' */ |
| 31427 | |
| 31428 | /* SystemInitialize for Enabled SubSystem: '<S150>/Calculate_I_term' */ |
| 31429 | L4_MA_Calculate_I_term_Init(&L4_MABX_B.Calculate_I_term_e, |
| 31430 | &L4_MABX_DW.Calculate_I_term_e, &L4_MABX_P.Calculate_I_term_e); |
| 31431 | |
| 31432 | /* End of SystemInitialize for SubSystem: '<S150>/Calculate_I_term' */ |
| 31433 | |
| 31434 | /* SystemInitialize for Outport: '<S103>/PID_output' */ |
| 31435 | L4_MABX_B.If_Then_Else_fo.Switch = L4_MABX_P.PID_output_Y0_p; |
| 31436 | |
| 31437 | /* End of SystemInitialize for SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */ |
| 31438 | |
| 31439 | /* SystemInitialize for Chart: '<S79>/Chart' */ |
| 31440 | L4_MABX_DW.is_active_c19_SUB_L4_Task_10ms_ = 0U; |
| 31441 | L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 31442 | L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_NOT_AVAILABLE; |
| 31443 | L4_MABX_B.VehCtrlState = ENUM_AUTO_CTRL_VEHICLE_STATE_T_NOT_AVAILABLE; |
| 31444 | |
| 31445 | /* SystemInitialize for Enabled SubSystem: '<S79>/Engine_speed_target' */ |
| 31446 | /* SystemInitialize for Outport: '<S210>/Out1' */ |
| 31447 | L4_MABX_B.MinMax1_n = L4_MABX_P.Out1_Y0; |
| 31448 | |
| 31449 | /* End of SystemInitialize for SubSystem: '<S79>/Engine_speed_target' */ |
| 31450 | |
| 31451 | /* SystemInitialize for Chart: '<S211>/Relay_control_state_machine' */ |
| 31452 | L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 31453 | L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 31454 | L4_MABX_DW.temporalCounter_i1 = 0U; |
| 31455 | L4_MABX_DW.is_active_c6_SUB_L4_Task_10ms_S = 0U; |
| 31456 | L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 31457 | |
| 31458 | /* SystemInitialize for Chart: '<S283>/Chart' */ |
| 31459 | L4_MABX_DW.is_active_c12_SUB_L4_Task_10ms_ = 0U; |
| 31460 | L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 31461 | |
| 31462 | /* SystemInitialize for Enabled SubSystem: '<S283>/Slew_at_event' */ |
| 31463 | /* InitializeConditions for UnitDelay: '<S336>/Unit_Delay' */ |
| 31464 | L4_MABX_DW.Unit_Delay_DSTATE_bd = L4_MABX_P.Unit_Delay_InitialCondition_ls; |
| 31465 | |
| 31466 | /* InitializeConditions for UnitDelay: '<S337>/Unit_Delay' */ |
| 31467 | L4_MABX_DW.Unit_Delay_DSTATE_jt = L4_MABX_P.Unit_Delay_InitialCondition_i0; |
| 31468 | |
| 31469 | /* InitializeConditions for UnitDelay: '<S340>/FixPt Unit Delay2' */ |
| 31470 | L4_MABX_DW.FixPtUnitDelay2_DSTATE_j = |
| 31471 | L4_MABX_P.FixPtUnitDelay2_InitialCondit_c; |
| 31472 | |
| 31473 | /* InitializeConditions for UnitDelay: '<S340>/FixPt Unit Delay1' */ |
| 31474 | L4_MABX_DW.FixPtUnitDelay1_DSTATE_o = |
| 31475 | L4_MABX_P.FixPtUnitDelay1_InitialCondit_f; |
| 31476 | |
| 31477 | /* InitializeConditions for UnitDelay: '<S335>/Unit_Delay' */ |
| 31478 | L4_MABX_DW.Unit_Delay_DSTATE_ll = L4_MABX_P.Unit_Delay_InitialCondition_ld; |
| 31479 | |
| 31480 | /* SystemInitialize for Outport: '<S334>/F_Out_slewing' */ |
| 31481 | L4_MABX_B.LogicalOperator_dm = L4_MABX_P.F_Out_slewing_Y0; |
| 31482 | |
| 31483 | /* SystemInitialize for Outport: '<S334>/Out' */ |
| 31484 | L4_MABX_B.If_Then_Else_n3.Switch = L4_MABX_P.Out_Y0; |
| 31485 | |
| 31486 | /* End of SystemInitialize for SubSystem: '<S283>/Slew_at_event' */ |
| 31487 | /* End of SystemInitialize for SubSystem: '<S65>/Task_10ms' */ |
| 31488 | |
| 31489 | /* SystemInitialize for Enabled SubSystem: '<S625>/PosRapidUpdate_011' */ |
| 31490 | /* SystemInitialize for Outport: '<S626>/Latitude_' */ |
| 31491 | L4_MABX_B.SFunction1_o1_l1 = L4_MABX_P.Latitude_Y0; |
| 31492 | |
| 31493 | /* SystemInitialize for Outport: '<S626>/Longitude_' */ |
| 31494 | L4_MABX_B.SFunction1_o2_ic = L4_MABX_P.Longitude_Y0; |
| 31495 | |
| 31496 | /* SystemInitialize for Outport: '<S626>/RX status' */ |
| 31497 | L4_MABX_B.SFunction1_o3_lm = L4_MABX_P.RXstatus_Y0_ld; |
| 31498 | |
| 31499 | /* SystemInitialize for Outport: '<S626>/RX time' */ |
| 31500 | L4_MABX_B.SFunction1_o4_aq = L4_MABX_P.RXtime_Y0_em; |
| 31501 | |
| 31502 | /* SystemInitialize for Outport: '<S626>/RX delta time' */ |
| 31503 | L4_MABX_B.SFunction1_o5_o = L4_MABX_P.RXdeltatime_Y0_jp; |
| 31504 | |
| 31505 | /* End of SystemInitialize for SubSystem: '<S625>/PosRapidUpdate_011' */ |
| 31506 | |
| 31507 | /* SystemInitialize for Enabled SubSystem: '<S625>/PosRapidUpdate_1' */ |
| 31508 | /* SystemInitialize for Outport: '<S627>/Latitude_' */ |
| 31509 | L4_MABX_B.SFunction1_o1_de = L4_MABX_P.Latitude_Y0_e; |
| 31510 | |
| 31511 | /* SystemInitialize for Outport: '<S627>/Longitude_' */ |
| 31512 | L4_MABX_B.SFunction1_o2_ez = L4_MABX_P.Longitude_Y0_b; |
| 31513 | |
| 31514 | /* SystemInitialize for Outport: '<S627>/RX status' */ |
| 31515 | L4_MABX_B.SFunction1_o3_lxw = L4_MABX_P.RXstatus_Y0_ep; |
| 31516 | |
| 31517 | /* SystemInitialize for Outport: '<S627>/RX time' */ |
| 31518 | L4_MABX_B.SFunction1_o4_ls = L4_MABX_P.RXtime_Y0_a1; |
| 31519 | |
| 31520 | /* SystemInitialize for Outport: '<S627>/RX delta time' */ |
| 31521 | L4_MABX_B.SFunction1_o5_f = L4_MABX_P.RXdeltatime_Y0_b4; |
| 31522 | |
| 31523 | /* End of SystemInitialize for SubSystem: '<S625>/PosRapidUpdate_1' */ |
| 31524 | |
| 31525 | /* SystemInitialize for Enabled SubSystem: '<S505>/CCVS1_00' */ |
| 31526 | /* SystemInitialize for Outport: '<S506>/TwoSpeedAxleSwitch' */ |
| 31527 | L4_MABX_B.SFunction1_o1_fd = L4_MABX_P.TwoSpeedAxleSwitch_Y0; |
| 31528 | |
| 31529 | /* SystemInitialize for Outport: '<S506>/ParkingBrakeSwitch' */ |
| 31530 | L4_MABX_B.SFunction1_o2_ij = L4_MABX_P.ParkingBrakeSwitch_Y0; |
| 31531 | |
| 31532 | /* SystemInitialize for Outport: '<S506>/CruiseCtrlPauseSwitch' */ |
| 31533 | L4_MABX_B.SFunction1_o3_l1 = L4_MABX_P.CruiseCtrlPauseSwitch_Y0; |
| 31534 | |
| 31535 | /* SystemInitialize for Outport: '<S506>/ParkBrakeReleaseInhibitRq' */ |
| 31536 | L4_MABX_B.SFunction1_o4_fw = L4_MABX_P.ParkBrakeReleaseInhibitRq_Y0; |
| 31537 | |
| 31538 | /* SystemInitialize for Outport: '<S506>/WheelBasedVehicleSpeed' */ |
| 31539 | WheelBasedVehicleSpeed = L4_MABX_P.WheelBasedVehicleSpeed_Y0; |
| 31540 | |
| 31541 | /* SystemInitialize for Outport: '<S506>/CruiseCtrlActive' */ |
| 31542 | L4_MABX_B.SFunction1_o6_jo = L4_MABX_P.CruiseCtrlActive_Y0; |
| 31543 | |
| 31544 | /* SystemInitialize for Outport: '<S506>/CruiseCtrlEnableSwitch' */ |
| 31545 | L4_MABX_B.SFunction1_o7_ba = L4_MABX_P.CruiseCtrlEnableSwitch_Y0; |
| 31546 | |
| 31547 | /* SystemInitialize for Outport: '<S506>/BrakeSwitch' */ |
| 31548 | BrakeSwitch = L4_MABX_P.BrakeSwitch_Y0; |
| 31549 | |
| 31550 | /* SystemInitialize for Outport: '<S506>/ClutchSwitch' */ |
| 31551 | L4_MABX_B.SFunction1_o9_ig = L4_MABX_P.ClutchSwitch_Y0; |
| 31552 | |
| 31553 | /* SystemInitialize for Outport: '<S506>/CruiseCtrlSetSwitch' */ |
| 31554 | L4_MABX_B.SFunction1_o10_i = L4_MABX_P.CruiseCtrlSetSwitch_Y0; |
| 31555 | |
| 31556 | /* SystemInitialize for Outport: '<S506>/CruiseCtrlCoastSwitch' */ |
| 31557 | L4_MABX_B.SFunction1_o11_j = L4_MABX_P.CruiseCtrlCoastSwitch_Y0; |
| 31558 | |
| 31559 | /* SystemInitialize for Outport: '<S506>/CruiseCtrlResumeSwitch' */ |
| 31560 | L4_MABX_B.SFunction1_o12_bc = L4_MABX_P.CruiseCtrlResumeSwitch_Y0; |
| 31561 | |
| 31562 | /* SystemInitialize for Outport: '<S506>/CruiseCtrlAccelerateSwitch' */ |
| 31563 | L4_MABX_B.SFunction1_o13_oz = L4_MABX_P.CruiseCtrlAccelerateSwitch_Y0; |
| 31564 | |
| 31565 | /* SystemInitialize for Outport: '<S506>/CruiseCtrlSetSpeed' */ |
| 31566 | L4_MABX_B.SFunction1_o14_en = L4_MABX_P.CruiseCtrlSetSpeed_Y0; |
| 31567 | |
| 31568 | /* SystemInitialize for Outport: '<S506>/PTOGovernorState' */ |
| 31569 | L4_MABX_B.SFunction1_o15_i = L4_MABX_P.PTOGovernorState_Y0; |
| 31570 | |
| 31571 | /* SystemInitialize for Outport: '<S506>/CruiseCtrlStates' */ |
| 31572 | L4_MABX_B.SFunction1_o16_fi = L4_MABX_P.CruiseCtrlStates_Y0; |
| 31573 | |
| 31574 | /* SystemInitialize for Outport: '<S506>/EngIdleIncrementSwitch' */ |
| 31575 | L4_MABX_B.SFunction1_o17_e = L4_MABX_P.EngIdleIncrementSwitch_Y0; |
| 31576 | |
| 31577 | /* SystemInitialize for Outport: '<S506>/EngIdleDecrementSwitch' */ |
| 31578 | L4_MABX_B.SFunction1_o18_i = L4_MABX_P.EngIdleDecrementSwitch_Y0; |
| 31579 | |
| 31580 | /* SystemInitialize for Outport: '<S506>/EngTestModeSwitch' */ |
| 31581 | L4_MABX_B.SFunction1_o19_e = L4_MABX_P.EngTestModeSwitch_Y0; |
| 31582 | |
| 31583 | /* SystemInitialize for Outport: '<S506>/EngShutdownOverrideSwitch' */ |
| 31584 | L4_MABX_B.SFunction1_o20_l = L4_MABX_P.EngShutdownOverrideSwitch_Y0; |
| 31585 | |
| 31586 | /* SystemInitialize for Outport: '<S506>/RX status' */ |
| 31587 | L4_MABX_B.SFunction1_o21_mw = L4_MABX_P.RXstatus_Y0_fu; |
| 31588 | |
| 31589 | /* SystemInitialize for Outport: '<S506>/RX time' */ |
| 31590 | L4_MABX_B.SFunction1_o22_ft = L4_MABX_P.RXtime_Y0_c; |
| 31591 | |
| 31592 | /* SystemInitialize for Outport: '<S506>/RX delta time' */ |
| 31593 | L4_MABX_B.SFunction1_o23_n = L4_MABX_P.RXdeltatime_Y0_k; |
| 31594 | |
| 31595 | /* End of SystemInitialize for SubSystem: '<S505>/CCVS1_00' */ |
| 31596 | |
| 31597 | /* SystemInitialize for Enabled SubSystem: '<S509>/COGSOGRapidUpdate_00' */ |
| 31598 | /* SystemInitialize for Outport: '<S510>/SID' */ |
| 31599 | L4_MABX_B.SFunction1_o1_jo = L4_MABX_P.SID_Y0; |
| 31600 | |
| 31601 | /* SystemInitialize for Outport: '<S510>/COGReference' */ |
| 31602 | L4_MABX_B.SFunction1_o2_i2 = L4_MABX_P.COGReference_Y0; |
| 31603 | |
| 31604 | /* SystemInitialize for Outport: '<S510>/CourseOverGround' */ |
| 31605 | L4_MABX_B.SFunction1_o3_o1 = L4_MABX_P.CourseOverGround_Y0; |
| 31606 | |
| 31607 | /* SystemInitialize for Outport: '<S510>/SpeedOverGround' */ |
| 31608 | L4_MABX_B.SFunction1_o4_kv = L4_MABX_P.SpeedOverGround_Y0; |
| 31609 | |
| 31610 | /* SystemInitialize for Outport: '<S510>/RX status' */ |
| 31611 | L4_MABX_B.SFunction1_o5_fi = L4_MABX_P.RXstatus_Y0_m; |
| 31612 | |
| 31613 | /* SystemInitialize for Outport: '<S510>/RX time' */ |
| 31614 | L4_MABX_B.SFunction1_o6_db = L4_MABX_P.RXtime_Y0_k; |
| 31615 | |
| 31616 | /* SystemInitialize for Outport: '<S510>/RX delta time' */ |
| 31617 | L4_MABX_B.SFunction1_o7_ln = L4_MABX_P.RXdeltatime_Y0_g; |
| 31618 | |
| 31619 | /* End of SystemInitialize for SubSystem: '<S509>/COGSOGRapidUpdate_00' */ |
| 31620 | |
| 31621 | /* SystemInitialize for Enabled SubSystem: '<S509>/COGSOGRapidUpdate_1' */ |
| 31622 | /* SystemInitialize for Outport: '<S511>/SID' */ |
| 31623 | L4_MABX_B.SFunction1_o1_nl = L4_MABX_P.SID_Y0_e; |
| 31624 | |
| 31625 | /* SystemInitialize for Outport: '<S511>/COGReference' */ |
| 31626 | L4_MABX_B.SFunction1_o2_c0 = L4_MABX_P.COGReference_Y0_k; |
| 31627 | |
| 31628 | /* SystemInitialize for Outport: '<S511>/CourseOverGround' */ |
| 31629 | L4_MABX_B.SFunction1_o3_ar = L4_MABX_P.CourseOverGround_Y0_i; |
| 31630 | |
| 31631 | /* SystemInitialize for Outport: '<S511>/SpeedOverGround' */ |
| 31632 | L4_MABX_B.SFunction1_o4_po = L4_MABX_P.SpeedOverGround_Y0_l; |
| 31633 | |
| 31634 | /* SystemInitialize for Outport: '<S511>/RX status' */ |
| 31635 | L4_MABX_B.SFunction1_o5_fh = L4_MABX_P.RXstatus_Y0_je; |
| 31636 | |
| 31637 | /* SystemInitialize for Outport: '<S511>/RX time' */ |
| 31638 | L4_MABX_B.SFunction1_o6_e5 = L4_MABX_P.RXtime_Y0_go; |
| 31639 | |
| 31640 | /* SystemInitialize for Outport: '<S511>/RX delta time' */ |
| 31641 | L4_MABX_B.SFunction1_o7_a4 = L4_MABX_P.RXdeltatime_Y0_oc; |
| 31642 | |
| 31643 | /* End of SystemInitialize for SubSystem: '<S509>/COGSOGRapidUpdate_1' */ |
| 31644 | |
| 31645 | /* SystemInitialize for Atomic SubSystem: '<S849>/CAN_TX_100ms' */ |
| 31646 | /* SystemInitialize for Enabled SubSystem: '<S886>/Rolling_15_counter' */ |
| 31647 | /* InitializeConditions for UnitDelay: '<S928>/Unit_Delay' */ |
| 31648 | L4_MABX_DW.Unit_Delay_DSTATE = L4_MABX_P.Unit_Delay_InitialCondition_l0; |
| 31649 | |
| 31650 | /* SystemInitialize for Outport: '<S928>/Rolling_15_counter' */ |
| 31651 | L4_MABX_B.Unit_Delay = L4_MABX_P.Rolling_15_counter_Y0; |
| 31652 | |
| 31653 | /* End of SystemInitialize for SubSystem: '<S886>/Rolling_15_counter' */ |
| 31654 | |
| 31655 | /* SystemInitialize for Enabled SubSystem: '<S908>/PropB_XPR_FC' */ |
| 31656 | /* SystemInitialize for Outport: '<S910>/TX status' */ |
| 31657 | L4_MABX_B.SFunction1_o1_fs = L4_MABX_P.TXstatus_Y0_h0; |
| 31658 | |
| 31659 | /* SystemInitialize for Outport: '<S910>/TX time' */ |
| 31660 | L4_MABX_B.SFunction1_o2_l = L4_MABX_P.TXtime_Y0_f; |
| 31661 | |
| 31662 | /* SystemInitialize for Outport: '<S910>/TX delta time' */ |
| 31663 | L4_MABX_B.SFunction1_o3_b = L4_MABX_P.TXdeltatime_Y0_n; |
| 31664 | |
| 31665 | /* SystemInitialize for Outport: '<S910>/TX delay time' */ |
| 31666 | L4_MABX_B.SFunction1_o4_a3 = L4_MABX_P.TXdelaytime_Y0_k4; |
| 31667 | |
| 31668 | /* End of SystemInitialize for SubSystem: '<S908>/PropB_XPR_FC' */ |
| 31669 | |
| 31670 | /* SystemInitialize for Enabled SubSystem: '<S909>/PropB_XPR_FC' */ |
| 31671 | /* SystemInitialize for Outport: '<S911>/TX status' */ |
| 31672 | L4_MABX_B.SFunction1_o1_ou = L4_MABX_P.TXstatus_Y0_a; |
| 31673 | |
| 31674 | /* SystemInitialize for Outport: '<S911>/TX time' */ |
| 31675 | L4_MABX_B.SFunction1_o2_fr = L4_MABX_P.TXtime_Y0_i; |
| 31676 | |
| 31677 | /* SystemInitialize for Outport: '<S911>/TX delta time' */ |
| 31678 | L4_MABX_B.SFunction1_o3_d = L4_MABX_P.TXdeltatime_Y0_nh; |
| 31679 | |
| 31680 | /* SystemInitialize for Outport: '<S911>/TX delay time' */ |
| 31681 | L4_MABX_B.SFunction1_o4_bh = L4_MABX_P.TXdelaytime_Y0_kg; |
| 31682 | |
| 31683 | /* End of SystemInitialize for SubSystem: '<S909>/PropB_XPR_FC' */ |
| 31684 | |
| 31685 | /* SystemInitialize for Enabled SubSystem: '<S938>/Std_PosRapidUpdate_01' */ |
| 31686 | /* SystemInitialize for Outport: '<S939>/TX status' */ |
| 31687 | L4_MABX_B.SFunction1_o1_d = L4_MABX_P.TXstatus_Y0_p; |
| 31688 | |
| 31689 | /* SystemInitialize for Outport: '<S939>/TX time' */ |
| 31690 | L4_MABX_B.SFunction1_o2_om = L4_MABX_P.TXtime_Y0_m; |
| 31691 | |
| 31692 | /* SystemInitialize for Outport: '<S939>/TX delta time' */ |
| 31693 | L4_MABX_B.SFunction1_o3_ks = L4_MABX_P.TXdeltatime_Y0_a; |
| 31694 | |
| 31695 | /* SystemInitialize for Outport: '<S939>/TX delay time' */ |
| 31696 | L4_MABX_B.SFunction1_o4_ip = L4_MABX_P.TXdelaytime_Y0_c; |
| 31697 | |
| 31698 | /* End of SystemInitialize for SubSystem: '<S938>/Std_PosRapidUpdate_01' */ |
| 31699 | |
| 31700 | /* SystemInitialize for Enabled SubSystem: '<S888>/CCVS1_00' */ |
| 31701 | /* SystemInitialize for Outport: '<S890>/TX status' */ |
| 31702 | L4_MABX_B.SFunction1_o1_g = L4_MABX_P.TXstatus_Y0_n; |
| 31703 | |
| 31704 | /* SystemInitialize for Outport: '<S890>/TX time' */ |
| 31705 | L4_MABX_B.SFunction1_o2_hx = L4_MABX_P.TXtime_Y0_e; |
| 31706 | |
| 31707 | /* SystemInitialize for Outport: '<S890>/TX delta time' */ |
| 31708 | L4_MABX_B.SFunction1_o3_ae = L4_MABX_P.TXdeltatime_Y0_e; |
| 31709 | |
| 31710 | /* SystemInitialize for Outport: '<S890>/TX delay time' */ |
| 31711 | L4_MABX_B.SFunction1_o4_ay = L4_MABX_P.TXdelaytime_Y0_k; |
| 31712 | |
| 31713 | /* End of SystemInitialize for SubSystem: '<S888>/CCVS1_00' */ |
| 31714 | |
| 31715 | /* SystemInitialize for Enabled SubSystem: '<S889>/CCVS1_00' */ |
| 31716 | /* SystemInitialize for Outport: '<S891>/TX status' */ |
| 31717 | L4_MABX_B.SFunction1_o1_b2 = L4_MABX_P.TXstatus_Y0_c; |
| 31718 | |
| 31719 | /* SystemInitialize for Outport: '<S891>/TX time' */ |
| 31720 | L4_MABX_B.SFunction1_o2_ht = L4_MABX_P.TXtime_Y0_ea; |
| 31721 | |
| 31722 | /* SystemInitialize for Outport: '<S891>/TX delta time' */ |
| 31723 | L4_MABX_B.SFunction1_o3_a = L4_MABX_P.TXdeltatime_Y0_m; |
| 31724 | |
| 31725 | /* SystemInitialize for Outport: '<S891>/TX delay time' */ |
| 31726 | L4_MABX_B.SFunction1_o4_dk = L4_MABX_P.TXdelaytime_Y0_j; |
| 31727 | |
| 31728 | /* End of SystemInitialize for SubSystem: '<S889>/CCVS1_00' */ |
| 31729 | |
| 31730 | /* SystemInitialize for Enabled SubSystem: '<S892>/PropB_REAX_5_E4' */ |
| 31731 | /* SystemInitialize for Outport: '<S894>/TX status' */ |
| 31732 | L4_MABX_B.SFunction1_o1_f2 = L4_MABX_P.TXstatus_Y0_e; |
| 31733 | |
| 31734 | /* SystemInitialize for Outport: '<S894>/TX time' */ |
| 31735 | L4_MABX_B.SFunction1_o2_h3 = L4_MABX_P.TXtime_Y0_a; |
| 31736 | |
| 31737 | /* SystemInitialize for Outport: '<S894>/TX delta time' */ |
| 31738 | L4_MABX_B.SFunction1_o3_ff = L4_MABX_P.TXdeltatime_Y0_g; |
| 31739 | |
| 31740 | /* SystemInitialize for Outport: '<S894>/TX delay time' */ |
| 31741 | L4_MABX_B.SFunction1_o4_eo = L4_MABX_P.TXdelaytime_Y0_e; |
| 31742 | |
| 31743 | /* End of SystemInitialize for SubSystem: '<S892>/PropB_REAX_5_E4' */ |
| 31744 | |
| 31745 | /* SystemInitialize for Enabled SubSystem: '<S893>/PropB_REAX_5_E4' */ |
| 31746 | /* SystemInitialize for Outport: '<S895>/TX status' */ |
| 31747 | L4_MABX_B.SFunction1_o1_ah = L4_MABX_P.TXstatus_Y0_h; |
| 31748 | |
| 31749 | /* SystemInitialize for Outport: '<S895>/TX time' */ |
| 31750 | L4_MABX_B.SFunction1_o2_hw = L4_MABX_P.TXtime_Y0_n; |
| 31751 | |
| 31752 | /* SystemInitialize for Outport: '<S895>/TX delta time' */ |
| 31753 | L4_MABX_B.SFunction1_o3_c = L4_MABX_P.TXdeltatime_Y0_gu; |
| 31754 | |
| 31755 | /* SystemInitialize for Outport: '<S895>/TX delay time' */ |
| 31756 | L4_MABX_B.SFunction1_o4_d0 = L4_MABX_P.TXdelaytime_Y0_i; |
| 31757 | |
| 31758 | /* End of SystemInitialize for SubSystem: '<S893>/PropB_REAX_5_E4' */ |
| 31759 | |
| 31760 | /* SystemInitialize for Enabled SubSystem: '<S912>/Std_COGSOGRapidUpdate_01' */ |
| 31761 | /* SystemInitialize for Outport: '<S913>/TX status' */ |
| 31762 | L4_MABX_B.SFunction1_o1_k = L4_MABX_P.TXstatus_Y0_j; |
| 31763 | |
| 31764 | /* SystemInitialize for Outport: '<S913>/TX time' */ |
| 31765 | L4_MABX_B.SFunction1_o2_pc = L4_MABX_P.TXtime_Y0_ij; |
| 31766 | |
| 31767 | /* SystemInitialize for Outport: '<S913>/TX delta time' */ |
| 31768 | L4_MABX_B.SFunction1_o3_iv = L4_MABX_P.TXdeltatime_Y0_og; |
| 31769 | |
| 31770 | /* SystemInitialize for Outport: '<S913>/TX delay time' */ |
| 31771 | L4_MABX_B.SFunction1_o4_i5 = L4_MABX_P.TXdelaytime_Y0_i3; |
| 31772 | |
| 31773 | /* End of SystemInitialize for SubSystem: '<S912>/Std_COGSOGRapidUpdate_01' */ |
| 31774 | |
| 31775 | /* SystemInitialize for Enabled SubSystem: '<S914>/EBC1_TX' */ |
| 31776 | /* SystemInitialize for Outport: '<S915>/TX status' */ |
| 31777 | L4_MABX_B.SFunction1_o1_l = L4_MABX_P.TXstatus_Y0_g; |
| 31778 | |
| 31779 | /* SystemInitialize for Outport: '<S915>/TX time' */ |
| 31780 | L4_MABX_B.SFunction1_o2_p = L4_MABX_P.TXtime_Y0_fc; |
| 31781 | |
| 31782 | /* SystemInitialize for Outport: '<S915>/TX delta time' */ |
| 31783 | L4_MABX_B.SFunction1_o3_fs = L4_MABX_P.TXdeltatime_Y0_p; |
| 31784 | |
| 31785 | /* SystemInitialize for Outport: '<S915>/TX delay time' */ |
| 31786 | L4_MABX_B.SFunction1_o4_jc = L4_MABX_P.TXdelaytime_Y0_d5; |
| 31787 | |
| 31788 | /* End of SystemInitialize for SubSystem: '<S914>/EBC1_TX' */ |
| 31789 | /* End of SystemInitialize for SubSystem: '<S849>/CAN_TX_100ms' */ |
| 31790 | |
| 31791 | /* SystemInitialize for Atomic SubSystem: '<S849>/CAN_TX_10ms' */ |
| 31792 | /* InitializeConditions for UnitDelay: '<S1006>/Unit_Delay' */ |
| 31793 | L4_MABX_DW.Unit_Delay_DSTATE_lb = L4_MABX_P.Unit_Delay_InitialCondition_cs; |
| 31794 | |
| 31795 | /* InitializeConditions for UnitDelay: '<S1007>/Unit Delay' */ |
| 31796 | L4_MABX_DW.UnitDelay_DSTATE_bi = L4_MABX_P.UnitDelay_InitialCondition_mm; |
| 31797 | |
| 31798 | /* SystemInitialize for Enabled SubSystem: '<S951>/ACCS' */ |
| 31799 | /* SystemInitialize for Outport: '<S952>/TX status' */ |
| 31800 | L4_MABX_B.SFunction1_o1_il = L4_MABX_P.TXstatus_Y0_jm; |
| 31801 | |
| 31802 | /* SystemInitialize for Outport: '<S952>/TX time' */ |
| 31803 | L4_MABX_B.SFunction1_o2_hc = L4_MABX_P.TXtime_Y0_fm; |
| 31804 | |
| 31805 | /* SystemInitialize for Outport: '<S952>/TX delta time' */ |
| 31806 | L4_MABX_B.SFunction1_o3_ft = L4_MABX_P.TXdeltatime_Y0_p0; |
| 31807 | |
| 31808 | /* SystemInitialize for Outport: '<S952>/TX delay time' */ |
| 31809 | L4_MABX_B.SFunction1_o4_b = L4_MABX_P.TXdelaytime_Y0_m; |
| 31810 | |
| 31811 | /* End of SystemInitialize for SubSystem: '<S951>/ACCS' */ |
| 31812 | |
| 31813 | /* SystemInitialize for Enabled SubSystem: '<S959>/EEC1_00' */ |
| 31814 | /* SystemInitialize for Outport: '<S961>/TX status' */ |
| 31815 | L4_MABX_B.SFunction1_o1_o = L4_MABX_P.TXstatus_Y0_ey; |
| 31816 | |
| 31817 | /* SystemInitialize for Outport: '<S961>/TX time' */ |
| 31818 | L4_MABX_B.SFunction1_o2_di = L4_MABX_P.TXtime_Y0_g; |
| 31819 | |
| 31820 | /* SystemInitialize for Outport: '<S961>/TX delta time' */ |
| 31821 | L4_MABX_B.SFunction1_o3_p4 = L4_MABX_P.TXdeltatime_Y0_pe; |
| 31822 | |
| 31823 | /* SystemInitialize for Outport: '<S961>/TX delay time' */ |
| 31824 | L4_MABX_B.SFunction1_o4_i = L4_MABX_P.TXdelaytime_Y0_jg; |
| 31825 | |
| 31826 | /* End of SystemInitialize for SubSystem: '<S959>/EEC1_00' */ |
| 31827 | |
| 31828 | /* SystemInitialize for Enabled SubSystem: '<S960>/EEC1_00' */ |
| 31829 | /* SystemInitialize for Outport: '<S962>/TX status' */ |
| 31830 | L4_MABX_B.SFunction1_o1_a = L4_MABX_P.TXstatus_Y0_e3; |
| 31831 | |
| 31832 | /* SystemInitialize for Outport: '<S962>/TX time' */ |
| 31833 | L4_MABX_B.SFunction1_o2_co = L4_MABX_P.TXtime_Y0_d; |
| 31834 | |
| 31835 | /* SystemInitialize for Outport: '<S962>/TX delta time' */ |
| 31836 | L4_MABX_B.SFunction1_o3_f1 = L4_MABX_P.TXdeltatime_Y0_ou; |
| 31837 | |
| 31838 | /* SystemInitialize for Outport: '<S962>/TX delay time' */ |
| 31839 | L4_MABX_B.SFunction1_o4_jm = L4_MABX_P.TXdelaytime_Y0_p; |
| 31840 | |
| 31841 | /* End of SystemInitialize for SubSystem: '<S960>/EEC1_00' */ |
| 31842 | |
| 31843 | /* SystemInitialize for Merge: '<S977>/Merge' */ |
| 31844 | L4_MABX_B.Merge = L4_MABX_P.Merge_InitialOutput; |
| 31845 | |
| 31846 | /* SystemInitialize for Enabled SubSystem: '<S963>/PropB_REAX_1_E4' */ |
| 31847 | /* SystemInitialize for Outport: '<S965>/TX status' */ |
| 31848 | L4_MABX_B.SFunction1_o1_mb = L4_MABX_P.TXstatus_Y0_k; |
| 31849 | |
| 31850 | /* SystemInitialize for Outport: '<S965>/TX time' */ |
| 31851 | L4_MABX_B.SFunction1_o2_a = L4_MABX_P.TXtime_Y0_h; |
| 31852 | |
| 31853 | /* SystemInitialize for Outport: '<S965>/TX delta time' */ |
| 31854 | L4_MABX_B.SFunction1_o3_kc = L4_MABX_P.TXdeltatime_Y0_f; |
| 31855 | |
| 31856 | /* SystemInitialize for Outport: '<S965>/TX delay time' */ |
| 31857 | L4_MABX_B.SFunction1_o4_c = L4_MABX_P.TXdelaytime_Y0_kc; |
| 31858 | |
| 31859 | /* End of SystemInitialize for SubSystem: '<S963>/PropB_REAX_1_E4' */ |
| 31860 | |
| 31861 | /* SystemInitialize for Enabled SubSystem: '<S964>/PropB_REAX_1_E4' */ |
| 31862 | /* SystemInitialize for Outport: '<S966>/TX status' */ |
| 31863 | L4_MABX_B.SFunction1_o1_b0 = L4_MABX_P.TXstatus_Y0_cr; |
| 31864 | |
| 31865 | /* SystemInitialize for Outport: '<S966>/TX time' */ |
| 31866 | L4_MABX_B.SFunction1_o2_ks = L4_MABX_P.TXtime_Y0_c; |
| 31867 | |
| 31868 | /* SystemInitialize for Outport: '<S966>/TX delta time' */ |
| 31869 | L4_MABX_B.SFunction1_o3_p = L4_MABX_P.TXdeltatime_Y0_ec; |
| 31870 | |
| 31871 | /* SystemInitialize for Outport: '<S966>/TX delay time' */ |
| 31872 | L4_MABX_B.SFunction1_o4_fu = L4_MABX_P.TXdelaytime_Y0_b; |
| 31873 | |
| 31874 | /* End of SystemInitialize for SubSystem: '<S964>/PropB_REAX_1_E4' */ |
| 31875 | |
| 31876 | /* SystemInitialize for Enabled SubSystem: '<S973>/VDC2_0B' */ |
| 31877 | /* SystemInitialize for Outport: '<S974>/TX status' */ |
| 31878 | L4_MABX_B.SFunction1_o1_mc = L4_MABX_P.TXstatus_Y0_f; |
| 31879 | |
| 31880 | /* SystemInitialize for Outport: '<S974>/TX time' */ |
| 31881 | L4_MABX_B.SFunction1_o2_nj = L4_MABX_P.TXtime_Y0_al; |
| 31882 | |
| 31883 | /* SystemInitialize for Outport: '<S974>/TX delta time' */ |
| 31884 | L4_MABX_B.SFunction1_o3_mw = L4_MABX_P.TXdeltatime_Y0_oo; |
| 31885 | |
| 31886 | /* SystemInitialize for Outport: '<S974>/TX delay time' */ |
| 31887 | L4_MABX_B.SFunction1_o4_l = L4_MABX_P.TXdelaytime_Y0_kb; |
| 31888 | |
| 31889 | /* End of SystemInitialize for SubSystem: '<S973>/VDC2_0B' */ |
| 31890 | /* End of SystemInitialize for SubSystem: '<S849>/CAN_TX_10ms' */ |
| 31891 | |
| 31892 | /* SystemInitialize for Atomic SubSystem: '<S849>/CAN_TX_20ms' */ |
| 31893 | /* InitializeConditions for UnitDelay: '<S1011>/Unit_Delay' */ |
| 31894 | L4_MABX_DW.Unit_Delay_DSTATE_id = L4_MABX_P.Unit_Delay_InitialCondition_gp; |
| 31895 | |
| 31896 | /* InitializeConditions for UnitDelay: '<S1034>/Unit_Delay' */ |
| 31897 | L4_MABX_DW.Unit_Delay_DSTATE_nj = L4_MABX_P.Unit_Delay_InitialCondition_mr; |
| 31898 | |
| 31899 | /* InitializeConditions for UnitDelay: '<S1035>/Unit Delay' */ |
| 31900 | L4_MABX_DW.UnitDelay_DSTATE_it = L4_MABX_P.UnitDelay_InitialCondition_b; |
| 31901 | |
| 31902 | /* SystemInitialize for Enabled SubSystem: '<S1018>/PropB_XBR_B3' */ |
| 31903 | /* SystemInitialize for Outport: '<S1019>/TX status' */ |
| 31904 | L4_MABX_B.SFunction1_o1_mx = L4_MABX_P.TXstatus_Y0_m; |
| 31905 | |
| 31906 | /* SystemInitialize for Outport: '<S1019>/TX time' */ |
| 31907 | L4_MABX_B.SFunction1_o2_cq = L4_MABX_P.TXtime_Y0_o; |
| 31908 | |
| 31909 | /* SystemInitialize for Outport: '<S1019>/TX delta time' */ |
| 31910 | L4_MABX_B.SFunction1_o3_oe = L4_MABX_P.TXdeltatime_Y0_l; |
| 31911 | |
| 31912 | /* SystemInitialize for Outport: '<S1019>/TX delay time' */ |
| 31913 | L4_MABX_B.SFunction1_o4_aw = L4_MABX_P.TXdelaytime_Y0_h; |
| 31914 | |
| 31915 | /* End of SystemInitialize for SubSystem: '<S1018>/PropB_XBR_B3' */ |
| 31916 | |
| 31917 | /* SystemInitialize for Enabled SubSystem: '<S1020>/PropB_Bendix_2C2_XPR' */ |
| 31918 | /* SystemInitialize for Outport: '<S1021>/TX status' */ |
| 31919 | L4_MABX_B.SFunction1_o1_bl = L4_MABX_P.TXstatus_Y0_d; |
| 31920 | |
| 31921 | /* SystemInitialize for Outport: '<S1021>/TX time' */ |
| 31922 | L4_MABX_B.SFunction1_o2_f = L4_MABX_P.TXtime_Y0_j; |
| 31923 | |
| 31924 | /* SystemInitialize for Outport: '<S1021>/TX delta time' */ |
| 31925 | L4_MABX_B.SFunction1_o3_o = L4_MABX_P.TXdeltatime_Y0_c; |
| 31926 | |
| 31927 | /* SystemInitialize for Outport: '<S1021>/TX delay time' */ |
| 31928 | L4_MABX_B.SFunction1_o4_o = L4_MABX_P.TXdelaytime_Y0_l; |
| 31929 | |
| 31930 | /* End of SystemInitialize for SubSystem: '<S1020>/PropB_Bendix_2C2_XPR' */ |
| 31931 | |
| 31932 | /* SystemInitialize for Enabled SubSystem: '<S1028>/Std_OdometryData' */ |
| 31933 | /* SystemInitialize for Outport: '<S1029>/TX status' */ |
| 31934 | L4_MABX_B.SFunction1_o1_nh = L4_MABX_P.TXstatus_Y0_cd; |
| 31935 | |
| 31936 | /* SystemInitialize for Outport: '<S1029>/TX time' */ |
| 31937 | L4_MABX_B.SFunction1_o2_hj = L4_MABX_P.TXtime_Y0_b; |
| 31938 | |
| 31939 | /* SystemInitialize for Outport: '<S1029>/TX delta time' */ |
| 31940 | L4_MABX_B.SFunction1_o3_m = L4_MABX_P.TXdeltatime_Y0_nt; |
| 31941 | |
| 31942 | /* SystemInitialize for Outport: '<S1029>/TX delay time' */ |
| 31943 | L4_MABX_B.SFunction1_o4_f = L4_MABX_P.TXdelaytime_Y0_n; |
| 31944 | |
| 31945 | /* End of SystemInitialize for SubSystem: '<S1028>/Std_OdometryData' */ |
| 31946 | /* End of SystemInitialize for SubSystem: '<S849>/CAN_TX_20ms' */ |
| 31947 | |
| 31948 | /* SystemInitialize for Atomic SubSystem: '<S849>/CAN_TX_5000ms' */ |
| 31949 | /* InitializeConditions for UnitDelay: '<S1049>/Unit_Delay' */ |
| 31950 | L4_MABX_DW.Unit_Delay_DSTATE_og = L4_MABX_P.Unit_Delay_InitialCondition_oe; |
| 31951 | |
| 31952 | /* InitializeConditions for UnitDelay: '<S1050>/Unit Delay' */ |
| 31953 | L4_MABX_DW.UnitDelay_DSTATE_b = L4_MABX_P.UnitDelay_InitialCondition_b3; |
| 31954 | |
| 31955 | /* SystemInitialize for Enabled SubSystem: '<S1043>/RQST_13_E4' */ |
| 31956 | /* SystemInitialize for Outport: '<S1045>/TX status' */ |
| 31957 | L4_MABX_B.SFunction1_o1_b = L4_MABX_P.TXstatus_Y0_hs; |
| 31958 | |
| 31959 | /* SystemInitialize for Outport: '<S1045>/TX time' */ |
| 31960 | L4_MABX_B.SFunction1_o2_d = L4_MABX_P.TXtime_Y0_jw; |
| 31961 | |
| 31962 | /* SystemInitialize for Outport: '<S1045>/TX delta time' */ |
| 31963 | L4_MABX_B.SFunction1_o3_gb = L4_MABX_P.TXdeltatime_Y0_d; |
| 31964 | |
| 31965 | /* SystemInitialize for Outport: '<S1045>/TX delay time' */ |
| 31966 | L4_MABX_B.SFunction1_o4_j = L4_MABX_P.TXdelaytime_Y0_nk; |
| 31967 | |
| 31968 | /* End of SystemInitialize for SubSystem: '<S1043>/RQST_13_E4' */ |
| 31969 | /* End of SystemInitialize for SubSystem: '<S849>/CAN_TX_5000ms' */ |
| 31970 | |
| 31971 | /* SystemInitialize for Enabled SubSystem: '<S640>/TC1_03_05' */ |
| 31972 | /* SystemInitialize for Outport: '<S641>/SPN681_TransGearShiftInhibitReq' */ |
| 31973 | L4_MABX_B.SFunction1_o1_c = L4_MABX_P.SPN681_TransGearShiftInhibitReq; |
| 31974 | |
| 31975 | /* SystemInitialize for Outport: '<S641>/SPN682_TransTrqConvLockupDisReq' */ |
| 31976 | L4_MABX_B.SFunction1_o2_e = L4_MABX_P.SPN682_TransTrqConvLockupDisReq; |
| 31977 | |
| 31978 | /* SystemInitialize for Outport: '<S641>/SPN683_DisengageDrivelineReq' */ |
| 31979 | L4_MABX_B.SFunction1_o3_bi = L4_MABX_P.SPN683_DisengageDrivelineReq_Y0; |
| 31980 | |
| 31981 | /* SystemInitialize for Outport: '<S641>/SPN4242_TransRevGearShiftInhibRq' */ |
| 31982 | L4_MABX_B.SFunction1_o4_lf = L4_MABX_P.SPN4242_TransRevGearShiftInhibR; |
| 31983 | |
| 31984 | /* SystemInitialize for Outport: '<S641>/SPN684_RequestedPercClutchSlip' */ |
| 31985 | L4_MABX_B.SFunction1_o5_p = L4_MABX_P.SPN684_RequestedPercClutchSlip_; |
| 31986 | |
| 31987 | /* SystemInitialize for Outport: '<S641>/SPN525_TransRequestedGear' */ |
| 31988 | L4_MABX_B.SFunction1_o6_i = L4_MABX_P.SPN525_TransRequestedGear_Y0; |
| 31989 | |
| 31990 | /* SystemInitialize for Outport: '<S641>/SPN685_DisengageDiffLockRqFrAx1' */ |
| 31991 | L4_MABX_B.SFunction1_o7_d = L4_MABX_P.SPN685_DisengageDiffLockRqFrAx1; |
| 31992 | |
| 31993 | /* SystemInitialize for Outport: '<S641>/SPN686_DisengageDiffLockRqFrAx2' */ |
| 31994 | L4_MABX_B.SFunction1_o8_a = L4_MABX_P.SPN686_DisengageDiffLockRqFrAx2; |
| 31995 | |
| 31996 | /* SystemInitialize for Outport: '<S641>/SPN687_DisengageDiffLockRqRrAx1' */ |
| 31997 | L4_MABX_B.SFunction1_o9_i = L4_MABX_P.SPN687_DisengageDiffLockRqRrAx1; |
| 31998 | |
| 31999 | /* SystemInitialize for Outport: '<S641>/SPN688_DisengageDiffLockRqRrAx2' */ |
| 32000 | L4_MABX_B.SFunction1_o10_o = L4_MABX_P.SPN688_DisengageDiffLockRqRrAx2; |
| 32001 | |
| 32002 | /* SystemInitialize for Outport: '<S641>/SPN689_DisengageDiffLockRqC' */ |
| 32003 | L4_MABX_B.SFunction1_o11 = L4_MABX_P.SPN689_DisengageDiffLockRqC_Y0; |
| 32004 | |
| 32005 | /* SystemInitialize for Outport: '<S641>/SPN690_DisengageDiffLockRqCF' */ |
| 32006 | L4_MABX_B.SFunction1_o12 = L4_MABX_P.SPN690_DisengageDiffLockRqCF_Y0; |
| 32007 | |
| 32008 | /* SystemInitialize for Outport: '<S641>/SPN691_DisengageDiffLockRqCR' */ |
| 32009 | L4_MABX_B.SFunction1_o13 = L4_MABX_P.SPN691_DisengageDiffLockRqCR_Y0; |
| 32010 | |
| 32011 | /* SystemInitialize for Outport: '<S641>/SPN5762_TransLoadRedInhibitRq' */ |
| 32012 | L4_MABX_B.SFunction1_o14 = L4_MABX_P.SPN5762_TransLoadRedInhibitRq_Y; |
| 32013 | |
| 32014 | /* SystemInitialize for Outport: '<S641>/SPN1852_TransmissionMode1' */ |
| 32015 | L4_MABX_B.SFunction1_o15 = L4_MABX_P.SPN1852_TransmissionMode1_Y0; |
| 32016 | |
| 32017 | /* SystemInitialize for Outport: '<S641>/SPN1853_TransmissionMode2' */ |
| 32018 | L4_MABX_B.SFunction1_o16 = L4_MABX_P.SPN1853_TransmissionMode2_Y0; |
| 32019 | |
| 32020 | /* SystemInitialize for Outport: '<S641>/SPN1854_TransmissionMode3' */ |
| 32021 | L4_MABX_B.SFunction1_o17 = L4_MABX_P.SPN1854_TransmissionMode3_Y0; |
| 32022 | |
| 32023 | /* SystemInitialize for Outport: '<S641>/SPN1855_TransmissionMode4' */ |
| 32024 | L4_MABX_B.SFunction1_o18 = L4_MABX_P.SPN1855_TransmissionMode4_Y0; |
| 32025 | |
| 32026 | /* SystemInitialize for Outport: '<S641>/SPN7695_TransAutoNeutralRequest' */ |
| 32027 | L4_MABX_B.SFunction1_o19 = L4_MABX_P.SPN7695_TransAutoNeutralRequest; |
| 32028 | |
| 32029 | /* SystemInitialize for Outport: '<S641>/SPN4255_TransRequestedLaunchGear' */ |
| 32030 | L4_MABX_B.SFunction1_o20 = L4_MABX_P.SPN4255_TransRequestedLaunchGea; |
| 32031 | |
| 32032 | /* SystemInitialize for Outport: '<S641>/SPN2985_TransShiftSelDispModeSw' */ |
| 32033 | L4_MABX_B.SFunction1_o21 = L4_MABX_P.SPN2985_TransShiftSelDispModeSw; |
| 32034 | |
| 32035 | /* SystemInitialize for Outport: '<S641>/SPN4246_TransmissionMode5' */ |
| 32036 | L4_MABX_B.SFunction1_o22 = L4_MABX_P.SPN4246_TransmissionMode5_Y0; |
| 32037 | |
| 32038 | /* SystemInitialize for Outport: '<S641>/SPN4247_TransmissionMode6' */ |
| 32039 | L4_MABX_B.SFunction1_o23 = L4_MABX_P.SPN4247_TransmissionMode6_Y0; |
| 32040 | |
| 32041 | /* SystemInitialize for Outport: '<S641>/SPN4248_TransmissionMode7' */ |
| 32042 | L4_MABX_B.SFunction1_o24 = L4_MABX_P.SPN4248_TransmissionMode7_Y0; |
| 32043 | |
| 32044 | /* SystemInitialize for Outport: '<S641>/SPN4249_TransmissionMode8' */ |
| 32045 | L4_MABX_B.SFunction1_o25 = L4_MABX_P.SPN4249_TransmissionMode8_Y0; |
| 32046 | |
| 32047 | /* SystemInitialize for Outport: '<S641>/RX status' */ |
| 32048 | L4_MABX_B.SFunction1_o26 = L4_MABX_P.RXstatus_Y0_o3; |
| 32049 | |
| 32050 | /* SystemInitialize for Outport: '<S641>/RX time' */ |
| 32051 | L4_MABX_B.SFunction1_o27 = L4_MABX_P.RXtime_Y0_lp; |
| 32052 | |
| 32053 | /* SystemInitialize for Outport: '<S641>/RX delta time' */ |
| 32054 | L4_MABX_B.SFunction1_o28 = L4_MABX_P.RXdeltatime_Y0_bu; |
| 32055 | |
| 32056 | /* End of SystemInitialize for SubSystem: '<S640>/TC1_03_05' */ |
| 32057 | |
| 32058 | /* SystemInitialize for Atomic SubSystem: '<S849>/CAN_TX_50ms' */ |
| 32059 | /* SystemInitialize for Enabled SubSystem: '<S1054>/CCVS1_E3' */ |
| 32060 | /* SystemInitialize for Outport: '<S1056>/TX status' */ |
| 32061 | L4_MABX_B.SFunction1_o1_j = L4_MABX_P.TXstatus_Y0_k0; |
| 32062 | |
| 32063 | /* SystemInitialize for Outport: '<S1056>/TX time' */ |
| 32064 | L4_MABX_B.SFunction1_o2_h4 = L4_MABX_P.TXtime_Y0_k; |
| 32065 | |
| 32066 | /* SystemInitialize for Outport: '<S1056>/TX delta time' */ |
| 32067 | L4_MABX_B.SFunction1_o3_f = L4_MABX_P.TXdeltatime_Y0_i; |
| 32068 | |
| 32069 | /* SystemInitialize for Outport: '<S1056>/TX delay time' */ |
| 32070 | L4_MABX_B.SFunction1_o4_m = L4_MABX_P.TXdelaytime_Y0_kx; |
| 32071 | |
| 32072 | /* End of SystemInitialize for SubSystem: '<S1054>/CCVS1_E3' */ |
| 32073 | |
| 32074 | /* SystemInitialize for Enabled SubSystem: '<S1055>/TC1_03_05' */ |
| 32075 | /* SystemInitialize for Outport: '<S1057>/TX status' */ |
| 32076 | L4_MABX_B.SFunction1_o1_f = L4_MABX_P.TXstatus_Y0_ma; |
| 32077 | |
| 32078 | /* SystemInitialize for Outport: '<S1057>/TX time' */ |
| 32079 | L4_MABX_B.SFunction1_o2_o = L4_MABX_P.TXtime_Y0_mg; |
| 32080 | |
| 32081 | /* SystemInitialize for Outport: '<S1057>/TX delta time' */ |
| 32082 | L4_MABX_B.SFunction1_o3_i = L4_MABX_P.TXdeltatime_Y0_k; |
| 32083 | |
| 32084 | /* SystemInitialize for Outport: '<S1057>/TX delay time' */ |
| 32085 | L4_MABX_B.SFunction1_o4_d = L4_MABX_P.TXdelaytime_Y0_ex; |
| 32086 | |
| 32087 | /* End of SystemInitialize for SubSystem: '<S1055>/TC1_03_05' */ |
| 32088 | /* End of SystemInitialize for SubSystem: '<S849>/CAN_TX_50ms' */ |
| 32089 | |
| 32090 | /* SystemInitialize for Enabled SubSystem: '<S638>/SystemTime_01' */ |
| 32091 | /* SystemInitialize for Outport: '<S639>/SID' */ |
| 32092 | L4_MABX_B.SFunction1_o1_mq = L4_MABX_P.SID_Y0_ez; |
| 32093 | |
| 32094 | /* SystemInitialize for Outport: '<S639>/Source' */ |
| 32095 | L4_MABX_B.SFunction1_o2_m = L4_MABX_P.Source_Y0; |
| 32096 | |
| 32097 | /* SystemInitialize for Outport: '<S639>/Date' */ |
| 32098 | L4_MABX_B.SFunction1_o3_l = L4_MABX_P.Date_Y0; |
| 32099 | |
| 32100 | /* SystemInitialize for Outport: '<S639>/Time' */ |
| 32101 | L4_MABX_B.SFunction1_o4_lz = L4_MABX_P.Time_Y0; |
| 32102 | |
| 32103 | /* SystemInitialize for Outport: '<S639>/RX status' */ |
| 32104 | L4_MABX_B.SFunction1_o5_g = L4_MABX_P.RXstatus_Y0_j1; |
| 32105 | |
| 32106 | /* SystemInitialize for Outport: '<S639>/RX time' */ |
| 32107 | L4_MABX_B.SFunction1_o6_p = L4_MABX_P.RXtime_Y0_at; |
| 32108 | |
| 32109 | /* SystemInitialize for Outport: '<S639>/RX delta time' */ |
| 32110 | L4_MABX_B.SFunction1_o7_m = L4_MABX_P.RXdeltatime_Y0_hc; |
| 32111 | |
| 32112 | /* End of SystemInitialize for SubSystem: '<S638>/SystemTime_01' */ |
| 32113 | |
| 32114 | /* SystemInitialize for Enabled SubSystem: '<S1067>/Std_SystemTime_01' */ |
| 32115 | /* SystemInitialize for Outport: '<S1069>/TX status' */ |
| 32116 | L4_MABX_B.SFunction1_o1_m = L4_MABX_P.TXstatus_Y0_mac; |
| 32117 | |
| 32118 | /* SystemInitialize for Outport: '<S1069>/TX time' */ |
| 32119 | L4_MABX_B.SFunction1_o2_g = L4_MABX_P.TXtime_Y0_i3; |
| 32120 | |
| 32121 | /* SystemInitialize for Outport: '<S1069>/TX delta time' */ |
| 32122 | L4_MABX_B.SFunction1_o3 = L4_MABX_P.TXdeltatime_Y0_i5; |
| 32123 | |
| 32124 | /* SystemInitialize for Outport: '<S1069>/TX delay time' */ |
| 32125 | L4_MABX_B.SFunction1_o4 = L4_MABX_P.TXdelaytime_Y0_mb; |
| 32126 | |
| 32127 | /* End of SystemInitialize for SubSystem: '<S1067>/Std_SystemTime_01' */ |
| 32128 | |
| 32129 | /* SystemInitialize for Triggered SubSystem: '<S1062>/CAN_TYPE1_TX_M1_C1' */ |
| 32130 | /* SystemInitialize for Outport: '<S1064>/TX status' */ |
| 32131 | L4_MABX_B.SFunction1_o1_n = L4_MABX_P.TXstatus_Y0_crr; |
| 32132 | |
| 32133 | /* SystemInitialize for Outport: '<S1064>/TX time' */ |
| 32134 | L4_MABX_B.SFunction1_o2_c = L4_MABX_P.TXtime_Y0_mt; |
| 32135 | |
| 32136 | /* SystemInitialize for Outport: '<S1064>/TX delta time' */ |
| 32137 | L4_MABX_B.SFunction1_o3_k = L4_MABX_P.TXdeltatime_Y0_b; |
| 32138 | |
| 32139 | /* SystemInitialize for Outport: '<S1064>/TX delay time' */ |
| 32140 | L4_MABX_B.SFunction1_o4_e = L4_MABX_P.TXdelaytime_Y0_f; |
| 32141 | |
| 32142 | /* End of SystemInitialize for SubSystem: '<S1062>/CAN_TYPE1_TX_M1_C1' */ |
| 32143 | |
| 32144 | /* SystemInitialize for Triggered SubSystem: '<S1063>/CAN_TYPE1_TX_M1_C1' */ |
| 32145 | /* SystemInitialize for Outport: '<S1065>/TX status' */ |
| 32146 | L4_MABX_B.SFunction1_o1_h = L4_MABX_P.TXstatus_Y0_ev; |
| 32147 | |
| 32148 | /* SystemInitialize for Outport: '<S1065>/TX time' */ |
| 32149 | L4_MABX_B.SFunction1_o2_h = L4_MABX_P.TXtime_Y0_hb; |
| 32150 | |
| 32151 | /* SystemInitialize for Outport: '<S1065>/TX delta time' */ |
| 32152 | L4_MABX_B.SFunction1_o3_g = L4_MABX_P.TXdeltatime_Y0_f4; |
| 32153 | |
| 32154 | /* SystemInitialize for Outport: '<S1065>/TX delay time' */ |
| 32155 | L4_MABX_B.SFunction1_o4_a = L4_MABX_P.TXdelaytime_Y0_g; |
| 32156 | |
| 32157 | /* End of SystemInitialize for SubSystem: '<S1063>/CAN_TYPE1_TX_M1_C1' */ |
| 32158 | |
| 32159 | /* SystemInitialize for Chart: '<S859>/Chart' */ |
| 32160 | L4_MABX_DW.temporalCounter_i1_c = 0U; |
| 32161 | L4_MABX_DW.is_active_c4_SUB_ECU_L4_MABX_HW = 0U; |
| 32162 | L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_NO_ACTIVE_CHILD; |
| 32163 | |
| 32164 | /* SystemInitialize for Enabled SubSystem: '<S573>/GNSSDOPs_011' */ |
| 32165 | /* SystemInitialize for Outport: '<S574>/SID' */ |
| 32166 | L4_MABX_B.SFunction1_o1_my = L4_MABX_P.SID_Y0_eo; |
| 32167 | |
| 32168 | /* SystemInitialize for Outport: '<S574>/SetMode' */ |
| 32169 | L4_MABX_B.SFunction1_o2_ad = L4_MABX_P.SetMode_Y0; |
| 32170 | |
| 32171 | /* SystemInitialize for Outport: '<S574>/OpMode' */ |
| 32172 | L4_MABX_B.SFunction1_o3_f3 = L4_MABX_P.OpMode_Y0; |
| 32173 | |
| 32174 | /* SystemInitialize for Outport: '<S574>/HDOP_' */ |
| 32175 | L4_MABX_B.SFunction1_o4_e5 = L4_MABX_P.HDOP_Y0; |
| 32176 | |
| 32177 | /* SystemInitialize for Outport: '<S574>/VDOP' */ |
| 32178 | L4_MABX_B.SFunction1_o5_b3 = L4_MABX_P.VDOP_Y0; |
| 32179 | |
| 32180 | /* SystemInitialize for Outport: '<S574>/TDOP' */ |
| 32181 | L4_MABX_B.SFunction1_o6_cz = L4_MABX_P.TDOP_Y0; |
| 32182 | |
| 32183 | /* SystemInitialize for Outport: '<S574>/RX status' */ |
| 32184 | L4_MABX_B.SFunction1_o7_id = L4_MABX_P.RXstatus_Y0_mn; |
| 32185 | |
| 32186 | /* SystemInitialize for Outport: '<S574>/RX time' */ |
| 32187 | L4_MABX_B.SFunction1_o8_g = L4_MABX_P.RXtime_Y0_ek; |
| 32188 | |
| 32189 | /* SystemInitialize for Outport: '<S574>/RX delta time' */ |
| 32190 | L4_MABX_B.SFunction1_o9_a = L4_MABX_P.RXdeltatime_Y0_n; |
| 32191 | |
| 32192 | /* End of SystemInitialize for SubSystem: '<S573>/GNSSDOPs_011' */ |
| 32193 | |
| 32194 | /* SystemInitialize for Enabled SubSystem: '<S573>/GNSSDOPs_1' */ |
| 32195 | /* SystemInitialize for Outport: '<S575>/SID' */ |
| 32196 | L4_MABX_B.SFunction1_o1_ks = L4_MABX_P.SID_Y0_d; |
| 32197 | |
| 32198 | /* SystemInitialize for Outport: '<S575>/SetMode' */ |
| 32199 | L4_MABX_B.SFunction1_o2_gq = L4_MABX_P.SetMode_Y0_a; |
| 32200 | |
| 32201 | /* SystemInitialize for Outport: '<S575>/OpMode' */ |
| 32202 | L4_MABX_B.SFunction1_o3_id = L4_MABX_P.OpMode_Y0_o; |
| 32203 | |
| 32204 | /* SystemInitialize for Outport: '<S575>/HDOP_' */ |
| 32205 | L4_MABX_B.SFunction1_o4_e1 = L4_MABX_P.HDOP_Y0_m; |
| 32206 | |
| 32207 | /* SystemInitialize for Outport: '<S575>/VDOP' */ |
| 32208 | L4_MABX_B.SFunction1_o5_cs = L4_MABX_P.VDOP_Y0_f; |
| 32209 | |
| 32210 | /* SystemInitialize for Outport: '<S575>/TDOP' */ |
| 32211 | L4_MABX_B.SFunction1_o6_na = L4_MABX_P.TDOP_Y0_g; |
| 32212 | |
| 32213 | /* SystemInitialize for Outport: '<S575>/RX status' */ |
| 32214 | L4_MABX_B.SFunction1_o7_g = L4_MABX_P.RXstatus_Y0_kl; |
| 32215 | |
| 32216 | /* SystemInitialize for Outport: '<S575>/RX time' */ |
| 32217 | L4_MABX_B.SFunction1_o8_dj = L4_MABX_P.RXtime_Y0_nx; |
| 32218 | |
| 32219 | /* SystemInitialize for Outport: '<S575>/RX delta time' */ |
| 32220 | L4_MABX_B.SFunction1_o9_dx = L4_MABX_P.RXdeltatime_Y0_nh; |
| 32221 | |
| 32222 | /* End of SystemInitialize for SubSystem: '<S573>/GNSSDOPs_1' */ |
| 32223 | |
| 32224 | /* SystemInitialize for Atomic SubSystem: '<S65>/Task_20ms' */ |
| 32225 | /* InitializeConditions for UnitDelay: '<S395>/Unit Delay1' */ |
| 32226 | L4_MABX_DW.UnitDelay1_DSTATE = L4_MABX_P.UnitDelay1_InitialCondition_p; |
| 32227 | |
| 32228 | /* InitializeConditions for DiscreteIntegrator: '<S396>/LongitudnalPosition' */ |
| 32229 | L4_MABX_DW.LongitudnalPosition_DSTATE = L4_MABX_B.InitialPosition; |
| 32230 | L4_MABX_DW.LongitudnalPosition_PrevResetSt = 2; |
| 32231 | |
| 32232 | /* InitializeConditions for DiscreteIntegrator: '<S396>/VehHeading' */ |
| 32233 | L4_MABX_DW.VehHeading_DSTATE = L4_MABX_B.InitialHeading; |
| 32234 | L4_MABX_DW.VehHeading_PrevResetState = 2; |
| 32235 | |
| 32236 | /* InitializeConditions for DiscreteIntegrator: '<S396>/XPosition' */ |
| 32237 | L4_MABX_DW.XPosition_DSTATE = L4_MABX_B.InitialXPosition; |
| 32238 | L4_MABX_DW.XPosition_PrevResetState = 2; |
| 32239 | |
| 32240 | /* InitializeConditions for DiscreteIntegrator: '<S396>/YPosition' */ |
| 32241 | L4_MABX_DW.YPosition_DSTATE = L4_MABX_B.InitialYPosition; |
| 32242 | L4_MABX_DW.YPosition_PrevResetState = 2; |
| 32243 | |
| 32244 | /* End of SystemInitialize for SubSystem: '<S65>/Task_20ms' */ |
| 32245 | |
| 32246 | /* SystemInitialize for S-Function (rti_commonblock): '<S408>/S-Function1' incorporates: |
| 32247 | * SubSystem: '<S399>/Background_Task' |
| 32248 | */ |
| 32249 | L4_MAB_Background_Task_Init(); |
| 32250 | |
| 32251 | /* End of SystemInitialize for S-Function (rti_commonblock): '<S408>/S-Function1' */ |
| 32252 | |
| 32253 | /* SystemInitialize for S-Function (rti_commonblock): '<S414>/S-Function1' incorporates: |
| 32254 | * SubSystem: '<S399>/Interrupt_Task' |
| 32255 | */ |
| 32256 | L4_MABX_Interrupt_Task_Init(); |
| 32257 | |
| 32258 | /* End of SystemInitialize for S-Function (rti_commonblock): '<S414>/S-Function1' */ |
| 32259 | |
| 32260 | /* SystemInitialize for Enabled SubSystem: '<S495>/AEBS1_A0' */ |
| 32261 | /* SystemInitialize for Outport: '<S496>/AdvEmergencyBrkSysState' */ |
| 32262 | L4_MABX_B.SFunction1_o1_c5 = L4_MABX_P.AdvEmergencyBrkSysState_Y0; |
| 32263 | |
| 32264 | /* SystemInitialize for Outport: '<S496>/CollisionWarningLevel' */ |
| 32265 | L4_MABX_B.SFunction1_o2_a1 = L4_MABX_P.CollisionWarningLevel_Y0; |
| 32266 | |
| 32267 | /* SystemInitialize for Outport: '<S496>/RelObjctDetForAdvEmergBrakingSys' */ |
| 32268 | L4_MABX_B.SFunction1_o3_mih = L4_MABX_P.RelObjctDetForAdvEmergBrakingSy; |
| 32269 | |
| 32270 | /* SystemInitialize for Outport: '<S496>/BendOffProbabOfRelevantObject' */ |
| 32271 | L4_MABX_B.SFunction1_o4_om = L4_MABX_P.BendOffProbabOfRelevantObject_Y; |
| 32272 | |
| 32273 | /* SystemInitialize for Outport: '<S496>/TimeToCollisionWithRelevantObj' */ |
| 32274 | L4_MABX_B.SFunction1_o5_ky = L4_MABX_P.TimeToCollisionWithRelevantObj_; |
| 32275 | |
| 32276 | /* SystemInitialize for Outport: '<S496>/RX status' */ |
| 32277 | L4_MABX_B.SFunction1_o6_iu = L4_MABX_P.RXstatus_Y0_a; |
| 32278 | |
| 32279 | /* SystemInitialize for Outport: '<S496>/RX time' */ |
| 32280 | L4_MABX_B.SFunction1_o7_m5 = L4_MABX_P.RXtime_Y0_g; |
| 32281 | |
| 32282 | /* SystemInitialize for Outport: '<S496>/RX delta time' */ |
| 32283 | L4_MABX_B.SFunction1_o8_i = L4_MABX_P.RXdeltatime_Y0_c3; |
| 32284 | |
| 32285 | /* End of SystemInitialize for SubSystem: '<S495>/AEBS1_A0' */ |
| 32286 | |
| 32287 | /* SystemInitialize for Enabled SubSystem: '<S501>/B2' */ |
| 32288 | /* SystemInitialize for Outport: '<S502>/BrakeAppPressDemanded' */ |
| 32289 | L4_MABX_B.SFunction1_o1_ng = L4_MABX_P.BrakeAppPressDemanded_Y0; |
| 32290 | |
| 32291 | /* SystemInitialize for Outport: '<S502>/BrakeSwitch2' */ |
| 32292 | L4_MABX_B.SFunction1_o2_cj = L4_MABX_P.BrakeSwitch2_Y0; |
| 32293 | |
| 32294 | /* SystemInitialize for Outport: '<S502>/RX status' */ |
| 32295 | L4_MABX_B.SFunction1_o3_ji3 = L4_MABX_P.RXstatus_Y0_jt; |
| 32296 | |
| 32297 | /* SystemInitialize for Outport: '<S502>/RX time' */ |
| 32298 | L4_MABX_B.SFunction1_o4_my = L4_MABX_P.RXtime_Y0_a; |
| 32299 | |
| 32300 | /* SystemInitialize for Outport: '<S502>/RX delta time' */ |
| 32301 | L4_MABX_B.SFunction1_o5_jz = L4_MABX_P.RXdeltatime_Y0_j; |
| 32302 | |
| 32303 | /* End of SystemInitialize for SubSystem: '<S501>/B2' */ |
| 32304 | |
| 32305 | /* SystemInitialize for Enabled SubSystem: '<S503>/Tracks' */ |
| 32306 | /* SystemInitialize for Outport: '<S504>/tr0_track_selection_status' */ |
| 32307 | L4_MABX_B.SFunction1_o1_cq = L4_MABX_P.tr0_track_selection_status_Y0; |
| 32308 | |
| 32309 | /* SystemInitialize for Outport: '<S504>/tr0_corrected_lateral_distance' */ |
| 32310 | L4_MABX_B.SFunction1_o2_is = L4_MABX_P.tr0_corrected_lateral_distance_; |
| 32311 | |
| 32312 | /* SystemInitialize for Outport: '<S504>/tr1_track_selection_status' */ |
| 32313 | L4_MABX_B.SFunction1_o3_ee = L4_MABX_P.tr1_track_selection_status_Y0; |
| 32314 | |
| 32315 | /* SystemInitialize for Outport: '<S504>/tr1_corrected_lateral_distance' */ |
| 32316 | L4_MABX_B.SFunction1_o4_dj = L4_MABX_P.tr1_corrected_lateral_distance_; |
| 32317 | |
| 32318 | /* SystemInitialize for Outport: '<S504>/tr2_track_selection_status' */ |
| 32319 | L4_MABX_B.SFunction1_o5_co = L4_MABX_P.tr2_track_selection_status_Y0; |
| 32320 | |
| 32321 | /* SystemInitialize for Outport: '<S504>/tr2_corrected_lateral_distance' */ |
| 32322 | L4_MABX_B.SFunction1_o6_hz = L4_MABX_P.tr2_corrected_lateral_distance_; |
| 32323 | |
| 32324 | /* SystemInitialize for Outport: '<S504>/tr3_track_selection_status' */ |
| 32325 | L4_MABX_B.SFunction1_o7_nm = L4_MABX_P.tr3_track_selection_status_Y0; |
| 32326 | |
| 32327 | /* SystemInitialize for Outport: '<S504>/tr3_corrected_lateral_distance' */ |
| 32328 | L4_MABX_B.SFunction1_o8_f0 = L4_MABX_P.tr3_corrected_lateral_distance_; |
| 32329 | |
| 32330 | /* SystemInitialize for Outport: '<S504>/tr4_track_selection_status' */ |
| 32331 | L4_MABX_B.SFunction1_o9_ct = L4_MABX_P.tr4_track_selection_status_Y0; |
| 32332 | |
| 32333 | /* SystemInitialize for Outport: '<S504>/tr4_corrected_lateral_distance' */ |
| 32334 | L4_MABX_B.SFunction1_o10_c3 = L4_MABX_P.tr4_corrected_lateral_distance_; |
| 32335 | |
| 32336 | /* SystemInitialize for Outport: '<S504>/tr5_track_selection_status' */ |
| 32337 | L4_MABX_B.SFunction1_o11_n = L4_MABX_P.tr5_track_selection_status_Y0; |
| 32338 | |
| 32339 | /* SystemInitialize for Outport: '<S504>/tr5_corrected_lateral_distance' */ |
| 32340 | L4_MABX_B.SFunction1_o12_a = L4_MABX_P.tr5_corrected_lateral_distance_; |
| 32341 | |
| 32342 | /* SystemInitialize for Outport: '<S504>/tr6_track_selection_status' */ |
| 32343 | L4_MABX_B.SFunction1_o13_f = L4_MABX_P.tr6_track_selection_status_Y0; |
| 32344 | |
| 32345 | /* SystemInitialize for Outport: '<S504>/tr6_corrected_lateral_distance' */ |
| 32346 | L4_MABX_B.SFunction1_o14_p = L4_MABX_P.tr6_corrected_lateral_distance_; |
| 32347 | |
| 32348 | /* SystemInitialize for Outport: '<S504>/tr7_track_selection_status' */ |
| 32349 | L4_MABX_B.SFunction1_o15_k = L4_MABX_P.tr7_track_selection_status_Y0; |
| 32350 | |
| 32351 | /* SystemInitialize for Outport: '<S504>/tr7_corrected_lateral_distance' */ |
| 32352 | L4_MABX_B.SFunction1_o16_b = L4_MABX_P.tr7_corrected_lateral_distance_; |
| 32353 | |
| 32354 | /* SystemInitialize for Outport: '<S504>/tr8_track_selection_status' */ |
| 32355 | L4_MABX_B.SFunction1_o17_p = L4_MABX_P.tr8_track_selection_status_Y0; |
| 32356 | |
| 32357 | /* SystemInitialize for Outport: '<S504>/tr8_corrected_lateral_distance' */ |
| 32358 | L4_MABX_B.SFunction1_o18_b = L4_MABX_P.tr8_corrected_lateral_distance_; |
| 32359 | |
| 32360 | /* SystemInitialize for Outport: '<S504>/tr9_track_selection_status' */ |
| 32361 | L4_MABX_B.SFunction1_o19_h = L4_MABX_P.tr9_track_selection_status_Y0; |
| 32362 | |
| 32363 | /* SystemInitialize for Outport: '<S504>/tr9_corrected_lateral_distance' */ |
| 32364 | L4_MABX_B.SFunction1_o20_h = L4_MABX_P.tr9_corrected_lateral_distance_; |
| 32365 | |
| 32366 | /* SystemInitialize for Outport: '<S504>/tr0_lateral_position' */ |
| 32367 | L4_MABX_B.SFunction1_o21_n = L4_MABX_P.tr0_lateral_position_Y0; |
| 32368 | |
| 32369 | /* SystemInitialize for Outport: '<S504>/tr1_lateral_position' */ |
| 32370 | L4_MABX_B.SFunction1_o22_ky = L4_MABX_P.tr1_lateral_position_Y0; |
| 32371 | |
| 32372 | /* SystemInitialize for Outport: '<S504>/tr2_lateral_position' */ |
| 32373 | L4_MABX_B.SFunction1_o23_i = L4_MABX_P.tr2_lateral_position_Y0; |
| 32374 | |
| 32375 | /* SystemInitialize for Outport: '<S504>/tr3_lateral_position' */ |
| 32376 | L4_MABX_B.SFunction1_o24_h = L4_MABX_P.tr3_lateral_position_Y0; |
| 32377 | |
| 32378 | /* SystemInitialize for Outport: '<S504>/tr4_lateral_position' */ |
| 32379 | L4_MABX_B.SFunction1_o25_j = L4_MABX_P.tr4_lateral_position_Y0; |
| 32380 | |
| 32381 | /* SystemInitialize for Outport: '<S504>/tr5_lateral_position' */ |
| 32382 | L4_MABX_B.SFunction1_o26_d = L4_MABX_P.tr5_lateral_position_Y0; |
| 32383 | |
| 32384 | /* SystemInitialize for Outport: '<S504>/tr6_lateral_position' */ |
| 32385 | L4_MABX_B.SFunction1_o27_c = L4_MABX_P.tr6_lateral_position_Y0; |
| 32386 | |
| 32387 | /* SystemInitialize for Outport: '<S504>/tr7_lateral_position' */ |
| 32388 | L4_MABX_B.SFunction1_o28_o = L4_MABX_P.tr7_lateral_position_Y0; |
| 32389 | |
| 32390 | /* SystemInitialize for Outport: '<S504>/tr8_lateral_position' */ |
| 32391 | L4_MABX_B.SFunction1_o29 = L4_MABX_P.tr8_lateral_position_Y0; |
| 32392 | |
| 32393 | /* SystemInitialize for Outport: '<S504>/tr9_lateral_position' */ |
| 32394 | L4_MABX_B.SFunction1_o30 = L4_MABX_P.tr9_lateral_position_Y0; |
| 32395 | |
| 32396 | /* SystemInitialize for Outport: '<S504>/tr0_range' */ |
| 32397 | L4_MABX_B.SFunction1_o31 = L4_MABX_P.tr0_range_Y0; |
| 32398 | |
| 32399 | /* SystemInitialize for Outport: '<S504>/tr1_range' */ |
| 32400 | L4_MABX_B.SFunction1_o32 = L4_MABX_P.tr1_range_Y0; |
| 32401 | |
| 32402 | /* SystemInitialize for Outport: '<S504>/tr2_range' */ |
| 32403 | L4_MABX_B.SFunction1_o33 = L4_MABX_P.tr2_range_Y0; |
| 32404 | |
| 32405 | /* SystemInitialize for Outport: '<S504>/tr3_range' */ |
| 32406 | L4_MABX_B.SFunction1_o34 = L4_MABX_P.tr3_range_Y0; |
| 32407 | |
| 32408 | /* SystemInitialize for Outport: '<S504>/tr4_range' */ |
| 32409 | L4_MABX_B.SFunction1_o35 = L4_MABX_P.tr4_range_Y0; |
| 32410 | |
| 32411 | /* SystemInitialize for Outport: '<S504>/tr5_range' */ |
| 32412 | L4_MABX_B.SFunction1_o36 = L4_MABX_P.tr5_range_Y0; |
| 32413 | |
| 32414 | /* SystemInitialize for Outport: '<S504>/tr6_range' */ |
| 32415 | L4_MABX_B.SFunction1_o37 = L4_MABX_P.tr6_range_Y0; |
| 32416 | |
| 32417 | /* SystemInitialize for Outport: '<S504>/tr7_range' */ |
| 32418 | L4_MABX_B.SFunction1_o38 = L4_MABX_P.tr7_range_Y0; |
| 32419 | |
| 32420 | /* SystemInitialize for Outport: '<S504>/tr8_range' */ |
| 32421 | L4_MABX_B.SFunction1_o39 = L4_MABX_P.tr8_range_Y0; |
| 32422 | |
| 32423 | /* SystemInitialize for Outport: '<S504>/tr9_range' */ |
| 32424 | L4_MABX_B.SFunction1_o40 = L4_MABX_P.tr9_range_Y0; |
| 32425 | |
| 32426 | /* SystemInitialize for Outport: '<S504>/tr0_radar_confidence' */ |
| 32427 | L4_MABX_B.SFunction1_o41 = L4_MABX_P.tr0_radar_confidence_Y0; |
| 32428 | |
| 32429 | /* SystemInitialize for Outport: '<S504>/tr1_radar_confidence' */ |
| 32430 | L4_MABX_B.SFunction1_o42 = L4_MABX_P.tr1_radar_confidence_Y0; |
| 32431 | |
| 32432 | /* SystemInitialize for Outport: '<S504>/tr2_radar_confidence' */ |
| 32433 | L4_MABX_B.SFunction1_o43 = L4_MABX_P.tr2_radar_confidence_Y0; |
| 32434 | |
| 32435 | /* SystemInitialize for Outport: '<S504>/tr3_radar_confidence' */ |
| 32436 | L4_MABX_B.SFunction1_o44 = L4_MABX_P.tr3_radar_confidence_Y0; |
| 32437 | |
| 32438 | /* SystemInitialize for Outport: '<S504>/tr4_radar_confidence' */ |
| 32439 | L4_MABX_B.SFunction1_o45 = L4_MABX_P.tr4_radar_confidence_Y0; |
| 32440 | |
| 32441 | /* SystemInitialize for Outport: '<S504>/tr5_radar_confidence' */ |
| 32442 | L4_MABX_B.SFunction1_o46 = L4_MABX_P.tr5_radar_confidence_Y0; |
| 32443 | |
| 32444 | /* SystemInitialize for Outport: '<S504>/tr6_radar_confidence' */ |
| 32445 | L4_MABX_B.SFunction1_o47 = L4_MABX_P.tr6_radar_confidence_Y0; |
| 32446 | |
| 32447 | /* SystemInitialize for Outport: '<S504>/tr7_radar_confidence' */ |
| 32448 | L4_MABX_B.SFunction1_o48 = L4_MABX_P.tr7_radar_confidence_Y0; |
| 32449 | |
| 32450 | /* SystemInitialize for Outport: '<S504>/tr8_radar_confidence' */ |
| 32451 | L4_MABX_B.SFunction1_o49 = L4_MABX_P.tr8_radar_confidence_Y0; |
| 32452 | |
| 32453 | /* SystemInitialize for Outport: '<S504>/tr9_radar_confidence' */ |
| 32454 | L4_MABX_B.SFunction1_o50 = L4_MABX_P.tr9_radar_confidence_Y0; |
| 32455 | |
| 32456 | /* SystemInitialize for Outport: '<S504>/tr0_relative_velocitiy' */ |
| 32457 | L4_MABX_B.SFunction1_o51 = L4_MABX_P.tr0_relative_velocitiy_Y0; |
| 32458 | |
| 32459 | /* SystemInitialize for Outport: '<S504>/tr0_acceleration_over_ground' */ |
| 32460 | L4_MABX_B.SFunction1_o52 = L4_MABX_P.tr0_acceleration_over_ground_Y0; |
| 32461 | |
| 32462 | /* SystemInitialize for Outport: '<S504>/tr1_relative_velocitiy' */ |
| 32463 | L4_MABX_B.SFunction1_o53 = L4_MABX_P.tr1_relative_velocitiy_Y0; |
| 32464 | |
| 32465 | /* SystemInitialize for Outport: '<S504>/tr1_acceleration_over_ground' */ |
| 32466 | L4_MABX_B.SFunction1_o54 = L4_MABX_P.tr1_acceleration_over_ground_Y0; |
| 32467 | |
| 32468 | /* SystemInitialize for Outport: '<S504>/tr2_relative_velocitiy' */ |
| 32469 | L4_MABX_B.SFunction1_o55 = L4_MABX_P.tr2_relative_velocitiy_Y0; |
| 32470 | |
| 32471 | /* SystemInitialize for Outport: '<S504>/tr2_acceleration_over_ground' */ |
| 32472 | L4_MABX_B.SFunction1_o56 = L4_MABX_P.tr2_acceleration_over_ground_Y0; |
| 32473 | |
| 32474 | /* SystemInitialize for Outport: '<S504>/tr3_relative_velocitiy' */ |
| 32475 | L4_MABX_B.SFunction1_o57 = L4_MABX_P.tr3_relative_velocitiy_Y0; |
| 32476 | |
| 32477 | /* SystemInitialize for Outport: '<S504>/tr3_acceleration_over_ground' */ |
| 32478 | L4_MABX_B.SFunction1_o58 = L4_MABX_P.tr3_acceleration_over_ground_Y0; |
| 32479 | |
| 32480 | /* SystemInitialize for Outport: '<S504>/tr4_relative_velocitiy' */ |
| 32481 | L4_MABX_B.SFunction1_o59 = L4_MABX_P.tr4_relative_velocitiy_Y0; |
| 32482 | |
| 32483 | /* SystemInitialize for Outport: '<S504>/tr4_acceleration_over_ground' */ |
| 32484 | L4_MABX_B.SFunction1_o60 = L4_MABX_P.tr4_acceleration_over_ground_Y0; |
| 32485 | |
| 32486 | /* SystemInitialize for Outport: '<S504>/tr5_relative_velocitiy' */ |
| 32487 | L4_MABX_B.SFunction1_o61 = L4_MABX_P.tr5_relative_velocitiy_Y0; |
| 32488 | |
| 32489 | /* SystemInitialize for Outport: '<S504>/tr5_acceleration_over_ground' */ |
| 32490 | L4_MABX_B.SFunction1_o62 = L4_MABX_P.tr5_acceleration_over_ground_Y0; |
| 32491 | |
| 32492 | /* SystemInitialize for Outport: '<S504>/tr6_relative_velocitiy' */ |
| 32493 | L4_MABX_B.SFunction1_o63 = L4_MABX_P.tr6_relative_velocitiy_Y0; |
| 32494 | |
| 32495 | /* SystemInitialize for Outport: '<S504>/tr6_acceleration_over_ground' */ |
| 32496 | L4_MABX_B.SFunction1_o64 = L4_MABX_P.tr6_acceleration_over_ground_Y0; |
| 32497 | |
| 32498 | /* SystemInitialize for Outport: '<S504>/tr7_relative_velocitiy' */ |
| 32499 | L4_MABX_B.SFunction1_o65 = L4_MABX_P.tr7_relative_velocitiy_Y0; |
| 32500 | |
| 32501 | /* SystemInitialize for Outport: '<S504>/tr7_acceleration_over_ground' */ |
| 32502 | L4_MABX_B.SFunction1_o66 = L4_MABX_P.tr7_acceleration_over_ground_Y0; |
| 32503 | |
| 32504 | /* SystemInitialize for Outport: '<S504>/tr8_relative_velocitiy' */ |
| 32505 | L4_MABX_B.SFunction1_o67 = L4_MABX_P.tr8_relative_velocitiy_Y0; |
| 32506 | |
| 32507 | /* SystemInitialize for Outport: '<S504>/tr8_acceleration_over_ground' */ |
| 32508 | L4_MABX_B.SFunction1_o68 = L4_MABX_P.tr8_acceleration_over_ground_Y0; |
| 32509 | |
| 32510 | /* SystemInitialize for Outport: '<S504>/tr9_relative_velocitiy' */ |
| 32511 | L4_MABX_B.SFunction1_o69 = L4_MABX_P.tr9_relative_velocitiy_Y0; |
| 32512 | |
| 32513 | /* SystemInitialize for Outport: '<S504>/tr9_acceleration_over_ground' */ |
| 32514 | L4_MABX_B.SFunction1_o70 = L4_MABX_P.tr9_acceleration_over_ground_Y0; |
| 32515 | |
| 32516 | /* SystemInitialize for Outport: '<S504>/track_multiplexor' */ |
| 32517 | L4_MABX_B.SFunction1_o71 = L4_MABX_P.track_multiplexor_Y0; |
| 32518 | |
| 32519 | /* SystemInitialize for Outport: '<S504>/RX status' */ |
| 32520 | L4_MABX_B.SFunction1_o72 = L4_MABX_P.RXstatus_Y0_gn; |
| 32521 | |
| 32522 | /* SystemInitialize for Outport: '<S504>/RX time' */ |
| 32523 | L4_MABX_B.SFunction1_o73 = L4_MABX_P.RXtime_Y0_e; |
| 32524 | |
| 32525 | /* SystemInitialize for Outport: '<S504>/RX delta time' */ |
| 32526 | L4_MABX_B.SFunction1_o74 = L4_MABX_P.RXdeltatime_Y0_l; |
| 32527 | |
| 32528 | /* End of SystemInitialize for SubSystem: '<S503>/Tracks' */ |
| 32529 | |
| 32530 | /* SystemInitialize for Enabled SubSystem: '<S514>/EBC1_0B' */ |
| 32531 | /* SystemInitialize for Outport: '<S515>/ASREngCtrlActive' */ |
| 32532 | L4_MABX_B.SFunction1_o1_efr = L4_MABX_P.ASREngCtrlActive_Y0; |
| 32533 | |
| 32534 | /* SystemInitialize for Outport: '<S515>/ASRBrakeCtrlActive' */ |
| 32535 | L4_MABX_B.SFunction1_o2_oh = L4_MABX_P.ASRBrakeCtrlActive_Y0; |
| 32536 | |
| 32537 | /* SystemInitialize for Outport: '<S515>/AntiLockBrakingActive' */ |
| 32538 | L4_MABX_B.SFunction1_o3_pjc = L4_MABX_P.AntiLockBrakingActive_Y0; |
| 32539 | |
| 32540 | /* SystemInitialize for Outport: '<S515>/EBSBrakeSwitch' */ |
| 32541 | L4_MABX_B.SFunction1_o4_d4 = L4_MABX_P.EBSBrakeSwitch_Y0; |
| 32542 | |
| 32543 | /* SystemInitialize for Outport: '<S515>/BrakePedalPos' */ |
| 32544 | L4_MABX_B.SFunction1_o5_ga = L4_MABX_P.BrakePedalPos_Y0; |
| 32545 | |
| 32546 | /* SystemInitialize for Outport: '<S515>/ABSOffroadSwitch' */ |
| 32547 | L4_MABX_B.SFunction1_o6_dt = L4_MABX_P.ABSOffroadSwitch_Y0; |
| 32548 | |
| 32549 | /* SystemInitialize for Outport: '<S515>/ASROffroadSwitch' */ |
| 32550 | L4_MABX_B.SFunction1_o7_d4 = L4_MABX_P.ASROffroadSwitch_Y0; |
| 32551 | |
| 32552 | /* SystemInitialize for Outport: '<S515>/ASRHillHolderSwitch' */ |
| 32553 | L4_MABX_B.SFunction1_o8_f = L4_MABX_P.ASRHillHolderSwitch_Y0; |
| 32554 | |
| 32555 | /* SystemInitialize for Outport: '<S515>/TractionCtrlOverrideSwitch' */ |
| 32556 | L4_MABX_B.SFunction1_o9_bc = L4_MABX_P.TractionCtrlOverrideSwitch_Y0; |
| 32557 | |
| 32558 | /* SystemInitialize for Outport: '<S515>/AccelInterlockSwitch' */ |
| 32559 | L4_MABX_B.SFunction1_o10_h = L4_MABX_P.AccelInterlockSwitch_Y0; |
| 32560 | |
| 32561 | /* SystemInitialize for Outport: '<S515>/EngDerateSwitch' */ |
| 32562 | L4_MABX_B.SFunction1_o11_kf = L4_MABX_P.EngDerateSwitch_Y0; |
| 32563 | |
| 32564 | /* SystemInitialize for Outport: '<S515>/EngAuxShutdownSwitch' */ |
| 32565 | L4_MABX_B.SFunction1_o12_p = L4_MABX_P.EngAuxShutdownSwitch_Y0; |
| 32566 | |
| 32567 | /* SystemInitialize for Outport: '<S515>/RemoteAccelEnableSwitch' */ |
| 32568 | L4_MABX_B.SFunction1_o13_h = L4_MABX_P.RemoteAccelEnableSwitch_Y0; |
| 32569 | |
| 32570 | /* SystemInitialize for Outport: '<S515>/EngRetarderSelection' */ |
| 32571 | L4_MABX_B.SFunction1_o14_d = L4_MABX_P.EngRetarderSelection_Y0; |
| 32572 | |
| 32573 | /* SystemInitialize for Outport: '<S515>/ABSFullyOperational' */ |
| 32574 | L4_MABX_B.SFunction1_o15_b = L4_MABX_P.ABSFullyOperational_Y0; |
| 32575 | |
| 32576 | /* SystemInitialize for Outport: '<S515>/EBSRedWarningSignal' */ |
| 32577 | L4_MABX_B.SFunction1_o16_p = L4_MABX_P.EBSRedWarningSignal_Y0; |
| 32578 | |
| 32579 | /* SystemInitialize for Outport: '<S515>/ABS_EBSAmberWarningSignal' */ |
| 32580 | L4_MABX_B.SFunction1_o17_o = L4_MABX_P.ABS_EBSAmberWarningSignal_Y0; |
| 32581 | |
| 32582 | /* SystemInitialize for Outport: '<S515>/ATC_ASRInformationSignal' */ |
| 32583 | L4_MABX_B.SFunction1_o18_n = L4_MABX_P.ATC_ASRInformationSignal_Y0; |
| 32584 | |
| 32585 | /* SystemInitialize for Outport: '<S515>/SrcAddrssOfCtrllngDvcFrBrkCntrl' */ |
| 32586 | L4_MABX_B.SFunction1_o19_l = L4_MABX_P.SrcAddrssOfCtrllngDvcFrBrkCntrl; |
| 32587 | |
| 32588 | /* SystemInitialize for Outport: '<S515>/HaltBrakeSwitch' */ |
| 32589 | L4_MABX_B.SFunction1_o20_a = L4_MABX_P.HaltBrakeSwitch_Y0; |
| 32590 | |
| 32591 | /* SystemInitialize for Outport: '<S515>/TrailerABSStatus' */ |
| 32592 | L4_MABX_B.SFunction1_o21_m = L4_MABX_P.TrailerABSStatus_Y0; |
| 32593 | |
| 32594 | /* SystemInitialize for Outport: '<S515>/TrctrMntdTrilerABSWarningSignal' */ |
| 32595 | L4_MABX_B.SFunction1_o22_a = L4_MABX_P.TrctrMntdTrilerABSWarningSignal; |
| 32596 | |
| 32597 | /* SystemInitialize for Outport: '<S515>/RX status' */ |
| 32598 | L4_MABX_B.SFunction1_o23_o = L4_MABX_P.RXstatus_Y0_k; |
| 32599 | |
| 32600 | /* SystemInitialize for Outport: '<S515>/RX time' */ |
| 32601 | L4_MABX_B.SFunction1_o24_o = L4_MABX_P.RXtime_Y0_nl; |
| 32602 | |
| 32603 | /* SystemInitialize for Outport: '<S515>/RX delta time' */ |
| 32604 | L4_MABX_B.SFunction1_o25_o = L4_MABX_P.RXdeltatime_Y0_b; |
| 32605 | |
| 32606 | /* End of SystemInitialize for SubSystem: '<S514>/EBC1_0B' */ |
| 32607 | |
| 32608 | /* SystemInitialize for Enabled SubSystem: '<S567>/EEC2_001' */ |
| 32609 | /* SystemInitialize for Outport: '<S568>/SPN558_AccelPed1LowIdlSwitch' */ |
| 32610 | L4_MABX_B.SFunction1_o1_hf = L4_MABX_P.SPN558_AccelPed1LowIdlSwitch_Y0; |
| 32611 | |
| 32612 | /* SystemInitialize for Outport: '<S568>/SPN559_AccelPedKickdownSw' */ |
| 32613 | L4_MABX_B.SFunction1_o2_pv = L4_MABX_P.SPN559_AccelPedKickdownSw_Y0; |
| 32614 | |
| 32615 | /* SystemInitialize for Outport: '<S568>/SPN1437_RoadSpeedLimitStatus' */ |
| 32616 | L4_MABX_B.SFunction1_o3_em = L4_MABX_P.SPN1437_RoadSpeedLimitStatus_Y0; |
| 32617 | |
| 32618 | /* SystemInitialize for Outport: '<S568>/SPN2970_AccelPed2LowIdlSwitch' */ |
| 32619 | L4_MABX_B.SFunction1_o4_dm = L4_MABX_P.SPN2970_AccelPed2LowIdlSwitch_Y; |
| 32620 | |
| 32621 | /* SystemInitialize for Outport: '<S568>/SPN91_AccelPedPos1' */ |
| 32622 | L4_MABX_B.SFunction1_o5_m4 = L4_MABX_P.SPN91_AccelPedPos1_Y0; |
| 32623 | |
| 32624 | /* SystemInitialize for Outport: '<S568>/SPN92_EngPercLoadAtCurrSpd' */ |
| 32625 | L4_MABX_B.SFunction1_o6_ip = L4_MABX_P.SPN92_EngPercLoadAtCurrSpd_Y0; |
| 32626 | |
| 32627 | /* SystemInitialize for Outport: '<S568>/SPN974_RemAccelPedalPosition' */ |
| 32628 | L4_MABX_B.SFunction1_o7_l = L4_MABX_P.SPN974_RemAccelPedalPosition_Y0; |
| 32629 | |
| 32630 | /* SystemInitialize for Outport: '<S568>/SPN29_AccelPedPos2' */ |
| 32631 | L4_MABX_B.SFunction1_o8_lq = L4_MABX_P.SPN29_AccelPedPos2_Y0; |
| 32632 | |
| 32633 | /* SystemInitialize for Outport: '<S568>/SPN2979_VehAccelRateLimStatus' */ |
| 32634 | L4_MABX_B.SFunction1_o9_jk = L4_MABX_P.SPN2979_VehAccelRateLimStatus_Y; |
| 32635 | |
| 32636 | /* SystemInitialize for Outport: '<S568>/SPN5021_MomEngMaxPwrEnFdbk' */ |
| 32637 | L4_MABX_B.SFunction1_o10_p = L4_MABX_P.SPN5021_MomEngMaxPwrEnFdbk_Y0; |
| 32638 | |
| 32639 | /* SystemInitialize for Outport: '<S568>/SPN5399_DPFThermMgmtActive' */ |
| 32640 | L4_MABX_B.SFunction1_o11_i = L4_MABX_P.SPN5399_DPFThermMgmtActive_Y0; |
| 32641 | |
| 32642 | /* SystemInitialize for Outport: '<S568>/SPN5400_SCRThermMgmtActive' */ |
| 32643 | L4_MABX_B.SFunction1_o12_k = L4_MABX_P.SPN5400_SCRThermMgmtActive_Y0; |
| 32644 | |
| 32645 | /* SystemInitialize for Outport: '<S568>/SPN3357_ActMaxAvailEngPercTrq' */ |
| 32646 | L4_MABX_B.SFunction1_o13_o = L4_MABX_P.SPN3357_ActMaxAvailEngPercTrq_Y; |
| 32647 | |
| 32648 | /* SystemInitialize for Outport: '<S568>/SPN5398_EstPumpingPercentTorque' */ |
| 32649 | L4_MABX_B.SFunction1_o14_g = L4_MABX_P.SPN5398_EstPumpingPercentTorque; |
| 32650 | |
| 32651 | /* SystemInitialize for Outport: '<S568>/RX status' */ |
| 32652 | L4_MABX_B.SFunction1_o15_e = L4_MABX_P.RXstatus_Y0_l; |
| 32653 | |
| 32654 | /* SystemInitialize for Outport: '<S568>/RX time' */ |
| 32655 | L4_MABX_B.SFunction1_o16_h = L4_MABX_P.RXtime_Y0_of; |
| 32656 | |
| 32657 | /* SystemInitialize for Outport: '<S568>/RX delta time' */ |
| 32658 | L4_MABX_B.SFunction1_o17_c = L4_MABX_P.RXdeltatime_Y0_kv; |
| 32659 | |
| 32660 | /* End of SystemInitialize for SubSystem: '<S567>/EEC2_001' */ |
| 32661 | |
| 32662 | /* SystemInitialize for Enabled SubSystem: '<S608>/CAN_TYPE1_RX_M1_C1' */ |
| 32663 | /* SystemInitialize for Outport: '<S612>/EPBPCMInhibitStatusFeedback' */ |
| 32664 | L4_MABX_B.SFunction1_o1_ll = L4_MABX_P.EPBPCMInhibitStatusFeedback_Y0; |
| 32665 | |
| 32666 | /* SystemInitialize for Outport: '<S612>/EPBPCMManualStatusFeedback' */ |
| 32667 | L4_MABX_B.SFunction1_o2_b2 = L4_MABX_P.EPBPCMManualStatusFeedback_Y0; |
| 32668 | |
| 32669 | /* SystemInitialize for Outport: '<S612>/RX status' */ |
| 32670 | L4_MABX_B.SFunction1_o3_fj = L4_MABX_P.RXstatus_Y0_jb; |
| 32671 | |
| 32672 | /* SystemInitialize for Outport: '<S612>/RX time' */ |
| 32673 | L4_MABX_B.SFunction1_o4_ob = L4_MABX_P.RXtime_Y0_le; |
| 32674 | |
| 32675 | /* SystemInitialize for Outport: '<S612>/RX delta time' */ |
| 32676 | L4_MABX_B.SFunction1_o5_k = L4_MABX_P.RXdeltatime_Y0_fg; |
| 32677 | |
| 32678 | /* End of SystemInitialize for SubSystem: '<S608>/CAN_TYPE1_RX_M1_C1' */ |
| 32679 | |
| 32680 | /* SystemInitialize for Enabled SubSystem: '<S609>/CAN_TYPE1_RX_M1_C2' */ |
| 32681 | /* SystemInitialize for Outport: '<S613>/EPBPCMInhibitStatusFeedback' */ |
| 32682 | L4_MABX_B.SFunction1_o1_kd = L4_MABX_P.EPBPCMInhibitStatusFeedback_Y_i; |
| 32683 | |
| 32684 | /* SystemInitialize for Outport: '<S613>/EPBPCMManualStatusFeedback' */ |
| 32685 | L4_MABX_B.SFunction1_o2_lm = L4_MABX_P.EPBPCMManualStatusFeedback_Y0_i; |
| 32686 | |
| 32687 | /* SystemInitialize for Outport: '<S613>/RX status' */ |
| 32688 | L4_MABX_B.SFunction1_o3_h = L4_MABX_P.RXstatus_Y0_pg; |
| 32689 | |
| 32690 | /* SystemInitialize for Outport: '<S613>/RX time' */ |
| 32691 | L4_MABX_B.SFunction1_o4_es = L4_MABX_P.RXtime_Y0_ao; |
| 32692 | |
| 32693 | /* SystemInitialize for Outport: '<S613>/RX delta time' */ |
| 32694 | L4_MABX_B.SFunction1_o5_no = L4_MABX_P.RXdeltatime_Y0_px; |
| 32695 | |
| 32696 | /* End of SystemInitialize for SubSystem: '<S609>/CAN_TYPE1_RX_M1_C2' */ |
| 32697 | |
| 32698 | /* SystemInitialize for Enabled SubSystem: '<S610>/CAN_TYPE1_RX_M2_C1' */ |
| 32699 | /* SystemInitialize for Outport: '<S614>/EPBPCMInhibitStatusFeedback' */ |
| 32700 | L4_MABX_B.SFunction1_o1_fk = L4_MABX_P.EPBPCMInhibitStatusFeedback_Y_d; |
| 32701 | |
| 32702 | /* SystemInitialize for Outport: '<S614>/EPBPCMManualStatusFeedback' */ |
| 32703 | L4_MABX_B.SFunction1_o2_es = L4_MABX_P.EPBPCMManualStatusFeedback_Y0_a; |
| 32704 | |
| 32705 | /* SystemInitialize for Outport: '<S614>/RX status' */ |
| 32706 | L4_MABX_B.SFunction1_o3_d3 = L4_MABX_P.RXstatus_Y0_eb; |
| 32707 | |
| 32708 | /* SystemInitialize for Outport: '<S614>/RX time' */ |
| 32709 | L4_MABX_B.SFunction1_o4_cvz = L4_MABX_P.RXtime_Y0_ou; |
| 32710 | |
| 32711 | /* SystemInitialize for Outport: '<S614>/RX delta time' */ |
| 32712 | L4_MABX_B.SFunction1_o5_n3 = L4_MABX_P.RXdeltatime_Y0_d; |
| 32713 | |
| 32714 | /* End of SystemInitialize for SubSystem: '<S610>/CAN_TYPE1_RX_M2_C1' */ |
| 32715 | |
| 32716 | /* SystemInitialize for Enabled SubSystem: '<S621>/PX2_LaneEdgeLeft' */ |
| 32717 | /* SystemInitialize for Outport: '<S622>/PX2_LaneEdgeLeftAngle' */ |
| 32718 | L4_MABX_B.SFunction1_o1_oj = L4_MABX_P.PX2_LaneEdgeLeftAngle_Y0; |
| 32719 | |
| 32720 | /* SystemInitialize for Outport: '<S622>/PX2_LaneEdgeLeftNumPoints' */ |
| 32721 | L4_MABX_B.SFunction1_o2_h2 = L4_MABX_P.PX2_LaneEdgeLeftNumPoints_Y0; |
| 32722 | |
| 32723 | /* SystemInitialize for Outport: '<S622>/PX2_LaneEdgeLeftPosition' */ |
| 32724 | L4_MABX_B.SFunction1_o3_im = L4_MABX_P.PX2_LaneEdgeLeftPosition_Y0; |
| 32725 | |
| 32726 | /* SystemInitialize for Outport: '<S622>/RX status' */ |
| 32727 | L4_MABX_B.SFunction1_o4_fr = L4_MABX_P.RXstatus_Y0_mm; |
| 32728 | |
| 32729 | /* SystemInitialize for Outport: '<S622>/RX time' */ |
| 32730 | L4_MABX_B.SFunction1_o5_j = L4_MABX_P.RXtime_Y0_l5; |
| 32731 | |
| 32732 | /* SystemInitialize for Outport: '<S622>/RX delta time' */ |
| 32733 | L4_MABX_B.SFunction1_o6_dw = L4_MABX_P.RXdeltatime_Y0_bn; |
| 32734 | |
| 32735 | /* End of SystemInitialize for SubSystem: '<S621>/PX2_LaneEdgeLeft' */ |
| 32736 | |
| 32737 | /* SystemInitialize for Enabled SubSystem: '<S621>/PX2_LaneEdgeRight' */ |
| 32738 | /* SystemInitialize for Outport: '<S623>/PX2_LaneEdgeRightAngle' */ |
| 32739 | L4_MABX_B.SFunction1_o1_lc = L4_MABX_P.PX2_LaneEdgeRightAngle_Y0; |
| 32740 | |
| 32741 | /* SystemInitialize for Outport: '<S623>/PX2_LaneEdgeRightNumPoints' */ |
| 32742 | L4_MABX_B.SFunction1_o2_fl = L4_MABX_P.PX2_LaneEdgeRightNumPoints_Y0; |
| 32743 | |
| 32744 | /* SystemInitialize for Outport: '<S623>/PX2_LaneEdgeRightPosition' */ |
| 32745 | L4_MABX_B.SFunction1_o3_n = L4_MABX_P.PX2_LaneEdgeRightPosition_Y0; |
| 32746 | |
| 32747 | /* SystemInitialize for Outport: '<S623>/RX status' */ |
| 32748 | L4_MABX_B.SFunction1_o4_c3 = L4_MABX_P.RXstatus_Y0_l1; |
| 32749 | |
| 32750 | /* SystemInitialize for Outport: '<S623>/RX time' */ |
| 32751 | L4_MABX_B.SFunction1_o5_c = L4_MABX_P.RXtime_Y0_ia; |
| 32752 | |
| 32753 | /* SystemInitialize for Outport: '<S623>/RX delta time' */ |
| 32754 | L4_MABX_B.SFunction1_o6_kd = L4_MABX_P.RXdeltatime_Y0_hj; |
| 32755 | |
| 32756 | /* End of SystemInitialize for SubSystem: '<S621>/PX2_LaneEdgeRight' */ |
| 32757 | |
| 32758 | /* SystemInitialize for Enabled SubSystem: '<S632>/PX2_MapLaneEgoLeft' */ |
| 32759 | /* SystemInitialize for Outport: '<S633>/PX2_MapLaneNearPos' */ |
| 32760 | L4_MABX_B.SFunction1_o1_mg = L4_MABX_P.PX2_MapLaneNearPos_Y0; |
| 32761 | |
| 32762 | /* SystemInitialize for Outport: '<S633>/PX2_MapLaneMidPos' */ |
| 32763 | L4_MABX_B.SFunction1_o2_n4 = L4_MABX_P.PX2_MapLaneMidPos_Y0; |
| 32764 | |
| 32765 | /* SystemInitialize for Outport: '<S633>/PX2_MapLaneFarPos' */ |
| 32766 | L4_MABX_B.SFunction1_o3_ot = L4_MABX_P.PX2_MapLaneFarPos_Y0; |
| 32767 | |
| 32768 | /* SystemInitialize for Outport: '<S633>/PX2_EgoLaneNearPosValid' */ |
| 32769 | L4_MABX_B.SFunction1_o4_fui = L4_MABX_P.PX2_EgoLaneNearPosValid_Y0; |
| 32770 | |
| 32771 | /* SystemInitialize for Outport: '<S633>/PX2_EgoLaneMidPosValid' */ |
| 32772 | L4_MABX_B.SFunction1_o5_e = L4_MABX_P.PX2_EgoLaneMidPosValid_Y0; |
| 32773 | |
| 32774 | /* SystemInitialize for Outport: '<S633>/PX2_EgoLaneFarPosValid' */ |
| 32775 | L4_MABX_B.SFunction1_o6_b = L4_MABX_P.PX2_EgoLaneFarPosValid_Y0; |
| 32776 | |
| 32777 | /* SystemInitialize for Outport: '<S633>/RX status' */ |
| 32778 | L4_MABX_B.SFunction1_o7_b = L4_MABX_P.RXstatus_Y0_n; |
| 32779 | |
| 32780 | /* SystemInitialize for Outport: '<S633>/RX time' */ |
| 32781 | L4_MABX_B.SFunction1_o8_a1 = L4_MABX_P.RXtime_Y0_kx; |
| 32782 | |
| 32783 | /* SystemInitialize for Outport: '<S633>/RX delta time' */ |
| 32784 | L4_MABX_B.SFunction1_o9_l = L4_MABX_P.RXdeltatime_Y0_gv; |
| 32785 | |
| 32786 | /* End of SystemInitialize for SubSystem: '<S632>/PX2_MapLaneEgoLeft' */ |
| 32787 | |
| 32788 | /* SystemInitialize for Enabled SubSystem: '<S634>/PX2_MapLaneEgoRight' */ |
| 32789 | /* SystemInitialize for Outport: '<S635>/PX2_MapLaneNearPos' */ |
| 32790 | L4_MABX_B.SFunction1_o1_aj = L4_MABX_P.PX2_MapLaneNearPos_Y0_l; |
| 32791 | |
| 32792 | /* SystemInitialize for Outport: '<S635>/PX2_MapLaneMidPos' */ |
| 32793 | L4_MABX_B.SFunction1_o2_i = L4_MABX_P.PX2_MapLaneMidPos_Y0_p; |
| 32794 | |
| 32795 | /* SystemInitialize for Outport: '<S635>/PX2_MapLaneFarPos' */ |
| 32796 | L4_MABX_B.SFunction1_o3_b4 = L4_MABX_P.PX2_MapLaneFarPos_Y0_g; |
| 32797 | |
| 32798 | /* SystemInitialize for Outport: '<S635>/PX2_EgoLaneNearPosValid' */ |
| 32799 | L4_MABX_B.SFunction1_o4_jz = L4_MABX_P.PX2_EgoLaneNearPosValid_Y0_h; |
| 32800 | |
| 32801 | /* SystemInitialize for Outport: '<S635>/PX2_EgoLaneMidPosValid' */ |
| 32802 | L4_MABX_B.SFunction1_o5_a = L4_MABX_P.PX2_EgoLaneMidPosValid_Y0_d; |
| 32803 | |
| 32804 | /* SystemInitialize for Outport: '<S635>/PX2_EgoLaneFarPosValid' */ |
| 32805 | L4_MABX_B.SFunction1_o6_d = L4_MABX_P.PX2_EgoLaneFarPosValid_Y0_h; |
| 32806 | |
| 32807 | /* SystemInitialize for Outport: '<S635>/RX status' */ |
| 32808 | L4_MABX_B.SFunction1_o7_ce = L4_MABX_P.RXstatus_Y0_fq; |
| 32809 | |
| 32810 | /* SystemInitialize for Outport: '<S635>/RX time' */ |
| 32811 | L4_MABX_B.SFunction1_o8_j = L4_MABX_P.RXtime_Y0_mc; |
| 32812 | |
| 32813 | /* SystemInitialize for Outport: '<S635>/RX delta time' */ |
| 32814 | L4_MABX_B.SFunction1_o9_h = L4_MABX_P.RXdeltatime_Y0_eg; |
| 32815 | |
| 32816 | /* End of SystemInitialize for SubSystem: '<S634>/PX2_MapLaneEgoRight' */ |
| 32817 | |
| 32818 | /* SystemInitialize for Enabled SubSystem: '<S636>/PX2_EgoLanePos' */ |
| 32819 | /* SystemInitialize for Outport: '<S637>/PX2_EgoLaneNearPosErr' */ |
| 32820 | L4_MABX_B.SFunction1_o1_fl = L4_MABX_P.PX2_EgoLaneNearPosErr_Y0; |
| 32821 | |
| 32822 | /* SystemInitialize for Outport: '<S637>/PX2_EgoLaneMidPosErr' */ |
| 32823 | L4_MABX_B.SFunction1_o2_a3 = L4_MABX_P.PX2_EgoLaneMidPosErr_Y0; |
| 32824 | |
| 32825 | /* SystemInitialize for Outport: '<S637>/PX2_EgoLaneFarPosErr' */ |
| 32826 | L4_MABX_B.SFunction1_o3_lx = L4_MABX_P.PX2_EgoLaneFarPosErr_Y0; |
| 32827 | |
| 32828 | /* SystemInitialize for Outport: '<S637>/PX2_EgoLaneNearPosValid' */ |
| 32829 | L4_MABX_B.SFunction1_o4_ox = L4_MABX_P.PX2_EgoLaneNearPosValid_Y0_l; |
| 32830 | |
| 32831 | /* SystemInitialize for Outport: '<S637>/PX2_EgoLaneMidPosValid' */ |
| 32832 | L4_MABX_B.SFunction1_o5_m = L4_MABX_P.PX2_EgoLaneMidPosValid_Y0_b; |
| 32833 | |
| 32834 | /* SystemInitialize for Outport: '<S637>/PX2_EgoLaneFarPosValid' */ |
| 32835 | L4_MABX_B.SFunction1_o6_k = L4_MABX_P.PX2_EgoLaneFarPosValid_Y0_p; |
| 32836 | |
| 32837 | /* SystemInitialize for Outport: '<S637>/RX status' */ |
| 32838 | L4_MABX_B.SFunction1_o7_i = L4_MABX_P.RXstatus_Y0_o; |
| 32839 | |
| 32840 | /* SystemInitialize for Outport: '<S637>/RX time' */ |
| 32841 | L4_MABX_B.SFunction1_o8_n = L4_MABX_P.RXtime_Y0_nk; |
| 32842 | |
| 32843 | /* SystemInitialize for Outport: '<S637>/RX delta time' */ |
| 32844 | L4_MABX_B.SFunction1_o9_o = L4_MABX_P.RXdeltatime_Y0_eu; |
| 32845 | |
| 32846 | /* End of SystemInitialize for SubSystem: '<S636>/PX2_EgoLanePos' */ |
| 32847 | |
| 32848 | /* SystemInitialize for Enabled SubSystem: '<S646>/VEP1' */ |
| 32849 | /* SystemInitialize for Outport: '<S647>/NetBatteryCurrent' */ |
| 32850 | L4_MABX_B.SFunction1_o1_n3 = L4_MABX_P.NetBatteryCurrent_Y0; |
| 32851 | |
| 32852 | /* SystemInitialize for Outport: '<S647>/AltCurrent' */ |
| 32853 | L4_MABX_B.SFunction1_o2_on = L4_MABX_P.AltCurrent_Y0; |
| 32854 | |
| 32855 | /* SystemInitialize for Outport: '<S647>/ChargingSystemPotential' */ |
| 32856 | L4_MABX_B.SFunction1_o3_m4 = L4_MABX_P.ChargingSystemPotential_Y0; |
| 32857 | |
| 32858 | /* SystemInitialize for Outport: '<S647>/BatteryPotential_PowerInput1' */ |
| 32859 | L4_MABX_B.SFunction1_o4_bg = L4_MABX_P.BatteryPotential_PowerInput1_Y0; |
| 32860 | |
| 32861 | /* SystemInitialize for Outport: '<S647>/KeyswitchBatteryPotential' */ |
| 32862 | L4_MABX_B.SFunction1_o5 = L4_MABX_P.KeyswitchBatteryPotential_Y0; |
| 32863 | |
| 32864 | /* SystemInitialize for Outport: '<S647>/RX status' */ |
| 32865 | L4_MABX_B.SFunction1_o6 = L4_MABX_P.RXstatus_Y0_gj; |
| 32866 | |
| 32867 | /* SystemInitialize for Outport: '<S647>/RX time' */ |
| 32868 | L4_MABX_B.SFunction1_o7 = L4_MABX_P.RXtime_Y0_ji; |
| 32869 | |
| 32870 | /* SystemInitialize for Outport: '<S647>/RX delta time' */ |
| 32871 | L4_MABX_B.SFunction1_o8 = L4_MABX_P.RXdeltatime_Y0_j4; |
| 32872 | |
| 32873 | /* End of SystemInitialize for SubSystem: '<S646>/VEP1' */ |
| 32874 | |
| 32875 | /* SystemInitialize for Enabled SubSystem: '<S469>/Decode_TPCM_CTS' */ |
| 32876 | /* SystemInitialize for Outport: '<S688>/Out' */ |
| 32877 | L4_MABX_B.SPN2556_ControlByte_nl = (uint8_T)L4_MABX_P.Out_Y0_o; |
| 32878 | L4_MABX_B.SPN2561_NumberOfPacketsThatCanB = (uint8_T)L4_MABX_P.Out_Y0_o; |
| 32879 | L4_MABX_B.SPN2562_NextPacketNumberToBeSen = (uint8_T)L4_MABX_P.Out_Y0_o; |
| 32880 | L4_MABX_B.DataType_kr = (uint32_T)L4_MABX_P.Out_Y0_o; |
| 32881 | |
| 32882 | /* End of SystemInitialize for SubSystem: '<S469>/Decode_TPCM_CTS' */ |
| 32883 | |
| 32884 | /* SystemInitialize for Enabled SubSystem: '<S469>/Decode_TPCM_ConnectionAbort' */ |
| 32885 | /* SystemInitialize for Outport: '<S689>/Out' */ |
| 32886 | L4_MABX_B.SPN2556_ControlByte_f = (uint8_T)L4_MABX_P.Out_Y0_g; |
| 32887 | L4_MABX_B.SPN2570_ConnectionAbortReason = (uint8_T)L4_MABX_P.Out_Y0_g; |
| 32888 | L4_MABX_B.DataType_o0 = (uint32_T)L4_MABX_P.Out_Y0_g; |
| 32889 | |
| 32890 | /* End of SystemInitialize for SubSystem: '<S469>/Decode_TPCM_ConnectionAbort' */ |
| 32891 | |
| 32892 | /* SystemInitialize for Enabled SubSystem: '<S469>/Decode_TPCM_EndOfMessageAck' */ |
| 32893 | /* SystemInitialize for Outport: '<S690>/Out' */ |
| 32894 | L4_MABX_B.SPN2556_ControlByte_n = (uint8_T)L4_MABX_P.Out_Y0_n; |
| 32895 | L4_MABX_B.DataType_oo = (uint16_T)L4_MABX_P.Out_Y0_n; |
| 32896 | L4_MABX_B.SPN2565_TotalNumberOfPackets = (uint8_T)L4_MABX_P.Out_Y0_n; |
| 32897 | L4_MABX_B.DataType_m00 = (uint32_T)L4_MABX_P.Out_Y0_n; |
| 32898 | |
| 32899 | /* End of SystemInitialize for SubSystem: '<S469>/Decode_TPCM_EndOfMessageAck' */ |
| 32900 | |
| 32901 | /* SystemInitialize for Enabled SubSystem: '<S469>/Decode_TPCM_RTS' */ |
| 32902 | /* SystemInitialize for Outport: '<S691>/Out' */ |
| 32903 | L4_MABX_B.SPN2556_ControlByte = (uint8_T)L4_MABX_P.Out_Y0_p; |
| 32904 | L4_MABX_B.DataType_p5 = (uint16_T)L4_MABX_P.Out_Y0_p; |
| 32905 | L4_MABX_B.SPN2558_TotalNumberOfPackets = (uint8_T)L4_MABX_P.Out_Y0_p; |
| 32906 | L4_MABX_B.SPN2559_MaximumNumberOfPackets = (uint8_T)L4_MABX_P.Out_Y0_p; |
| 32907 | L4_MABX_B.DataType_o3 = (uint32_T)L4_MABX_P.Out_Y0_p; |
| 32908 | |
| 32909 | /* End of SystemInitialize for SubSystem: '<S469>/Decode_TPCM_RTS' */ |
| 32910 | |
| 32911 | /* SystemInitialize for Enabled SubSystem: '<S582>/CAN_TYPE1_RX_M1_C1' */ |
| 32912 | /* SystemInitialize for Outport: '<S586>/byte1' */ |
| 32913 | L4_MABX_B.SFunction1_o1_ma = L4_MABX_P.byte1_Y0_d; |
| 32914 | |
| 32915 | /* SystemInitialize for Outport: '<S586>/byte2' */ |
| 32916 | L4_MABX_B.SFunction1_o2_k4 = L4_MABX_P.byte2_Y0_f; |
| 32917 | |
| 32918 | /* SystemInitialize for Outport: '<S586>/byte3' */ |
| 32919 | L4_MABX_B.SFunction1_o3_p4z = L4_MABX_P.byte3_Y0_i; |
| 32920 | |
| 32921 | /* SystemInitialize for Outport: '<S586>/byte4' */ |
| 32922 | L4_MABX_B.SFunction1_o4_b3 = L4_MABX_P.byte4_Y0_e; |
| 32923 | |
| 32924 | /* SystemInitialize for Outport: '<S586>/byte5' */ |
| 32925 | L4_MABX_B.SFunction1_o5_bb = L4_MABX_P.byte5_Y0_e; |
| 32926 | |
| 32927 | /* SystemInitialize for Outport: '<S586>/byte6' */ |
| 32928 | L4_MABX_B.SFunction1_o6_f = L4_MABX_P.byte6_Y0_h; |
| 32929 | |
| 32930 | /* SystemInitialize for Outport: '<S586>/byte7' */ |
| 32931 | L4_MABX_B.SFunction1_o7_kh = L4_MABX_P.byte7_Y0_e; |
| 32932 | |
| 32933 | /* SystemInitialize for Outport: '<S586>/byte8' */ |
| 32934 | L4_MABX_B.SFunction1_o8_od = L4_MABX_P.byte8_Y0_co; |
| 32935 | |
| 32936 | /* SystemInitialize for Outport: '<S586>/RX status' */ |
| 32937 | L4_MABX_B.SFunction1_o9_hj = L4_MABX_P.RXstatus_Y0_a1; |
| 32938 | |
| 32939 | /* SystemInitialize for Outport: '<S586>/RX time' */ |
| 32940 | L4_MABX_B.SFunction1_o10_n5 = L4_MABX_P.RXtime_Y0_mr; |
| 32941 | |
| 32942 | /* SystemInitialize for Outport: '<S586>/RX delta time' */ |
| 32943 | L4_MABX_B.SFunction1_o11_e = L4_MABX_P.RXdeltatime_Y0_h; |
| 32944 | |
| 32945 | /* End of SystemInitialize for SubSystem: '<S582>/CAN_TYPE1_RX_M1_C1' */ |
| 32946 | |
| 32947 | /* SystemInitialize for Enabled SubSystem: '<S583>/CAN_TYPE1_RX_M1_C2' */ |
| 32948 | /* SystemInitialize for Outport: '<S587>/byte1' */ |
| 32949 | L4_MABX_B.SFunction1_o1_ef = L4_MABX_P.byte1_Y0_m; |
| 32950 | |
| 32951 | /* SystemInitialize for Outport: '<S587>/byte2' */ |
| 32952 | L4_MABX_B.SFunction1_o2_ono = L4_MABX_P.byte2_Y0_ft; |
| 32953 | |
| 32954 | /* SystemInitialize for Outport: '<S587>/byte3' */ |
| 32955 | L4_MABX_B.SFunction1_o3_pu = L4_MABX_P.byte3_Y0_p; |
| 32956 | |
| 32957 | /* SystemInitialize for Outport: '<S587>/byte4' */ |
| 32958 | L4_MABX_B.SFunction1_o4_ex = L4_MABX_P.byte4_Y0_i; |
| 32959 | |
| 32960 | /* SystemInitialize for Outport: '<S587>/byte5' */ |
| 32961 | L4_MABX_B.SFunction1_o5_og = L4_MABX_P.byte5_Y0_g; |
| 32962 | |
| 32963 | /* SystemInitialize for Outport: '<S587>/byte6' */ |
| 32964 | L4_MABX_B.SFunction1_o6_j = L4_MABX_P.byte6_Y0_p; |
| 32965 | |
| 32966 | /* SystemInitialize for Outport: '<S587>/byte7' */ |
| 32967 | L4_MABX_B.SFunction1_o7_oj = L4_MABX_P.byte7_Y0_k; |
| 32968 | |
| 32969 | /* SystemInitialize for Outport: '<S587>/byte8' */ |
| 32970 | L4_MABX_B.SFunction1_o8_l = L4_MABX_P.byte8_Y0_j; |
| 32971 | |
| 32972 | /* SystemInitialize for Outport: '<S587>/RX status' */ |
| 32973 | L4_MABX_B.SFunction1_o9_j = L4_MABX_P.RXstatus_Y0_in; |
| 32974 | |
| 32975 | /* SystemInitialize for Outport: '<S587>/RX time' */ |
| 32976 | L4_MABX_B.SFunction1_o10_ay = L4_MABX_P.RXtime_Y0_o1; |
| 32977 | |
| 32978 | /* SystemInitialize for Outport: '<S587>/RX delta time' */ |
| 32979 | L4_MABX_B.SFunction1_o11_om = L4_MABX_P.RXdeltatime_Y0_l0; |
| 32980 | |
| 32981 | /* End of SystemInitialize for SubSystem: '<S583>/CAN_TYPE1_RX_M1_C2' */ |
| 32982 | |
| 32983 | /* SystemInitialize for Enabled SubSystem: '<S584>/CAN_TYPE1_RX_M3_C2' */ |
| 32984 | /* SystemInitialize for Outport: '<S588>/byte1' */ |
| 32985 | L4_MABX_B.SFunction1_o1_bn = L4_MABX_P.byte1_Y0_o; |
| 32986 | |
| 32987 | /* SystemInitialize for Outport: '<S588>/byte2' */ |
| 32988 | L4_MABX_B.SFunction1_o2_mn = L4_MABX_P.byte2_Y0_e; |
| 32989 | |
| 32990 | /* SystemInitialize for Outport: '<S588>/byte3' */ |
| 32991 | L4_MABX_B.SFunction1_o3_aj = L4_MABX_P.byte3_Y0_o; |
| 32992 | |
| 32993 | /* SystemInitialize for Outport: '<S588>/byte4' */ |
| 32994 | L4_MABX_B.SFunction1_o4_kp = L4_MABX_P.byte4_Y0_j; |
| 32995 | |
| 32996 | /* SystemInitialize for Outport: '<S588>/byte5' */ |
| 32997 | L4_MABX_B.SFunction1_o5_nb = L4_MABX_P.byte5_Y0_k; |
| 32998 | |
| 32999 | /* SystemInitialize for Outport: '<S588>/byte6' */ |
| 33000 | L4_MABX_B.SFunction1_o6_g = L4_MABX_P.byte6_Y0_k; |
| 33001 | |
| 33002 | /* SystemInitialize for Outport: '<S588>/byte7' */ |
| 33003 | L4_MABX_B.SFunction1_o7_of = L4_MABX_P.byte7_Y0_h; |
| 33004 | |
| 33005 | /* SystemInitialize for Outport: '<S588>/byte8' */ |
| 33006 | L4_MABX_B.SFunction1_o8_ah = L4_MABX_P.byte8_Y0_m; |
| 33007 | |
| 33008 | /* SystemInitialize for Outport: '<S588>/RX status' */ |
| 33009 | L4_MABX_B.SFunction1_o9_b = L4_MABX_P.RXstatus_Y0_d; |
| 33010 | |
| 33011 | /* SystemInitialize for Outport: '<S588>/RX time' */ |
| 33012 | L4_MABX_B.SFunction1_o10_k = L4_MABX_P.RXtime_Y0_ma; |
| 33013 | |
| 33014 | /* SystemInitialize for Outport: '<S588>/RX delta time' */ |
| 33015 | L4_MABX_B.SFunction1_o11_kc = L4_MABX_P.RXdeltatime_Y0_m; |
| 33016 | |
| 33017 | /* End of SystemInitialize for SubSystem: '<S584>/CAN_TYPE1_RX_M3_C2' */ |
| 33018 | |
| 33019 | /* SystemInitialize for Enabled SubSystem: '<S595>/CAN_TYPE1_RX_M1_C1' */ |
| 33020 | /* SystemInitialize for Outport: '<S599>/byte1' */ |
| 33021 | L4_MABX_B.SFunction1_o1_ek = L4_MABX_P.byte1_Y0_k; |
| 33022 | |
| 33023 | /* SystemInitialize for Outport: '<S599>/byte2' */ |
| 33024 | L4_MABX_B.SFunction1_o2_cf = L4_MABX_P.byte2_Y0_k; |
| 33025 | |
| 33026 | /* SystemInitialize for Outport: '<S599>/byte3' */ |
| 33027 | L4_MABX_B.SFunction1_o3_bl = L4_MABX_P.byte3_Y0_l; |
| 33028 | |
| 33029 | /* SystemInitialize for Outport: '<S599>/byte4' */ |
| 33030 | L4_MABX_B.SFunction1_o4_p = L4_MABX_P.byte4_Y0_f; |
| 33031 | |
| 33032 | /* SystemInitialize for Outport: '<S599>/byte5' */ |
| 33033 | L4_MABX_B.SFunction1_o5_ed = L4_MABX_P.byte5_Y0_d; |
| 33034 | |
| 33035 | /* SystemInitialize for Outport: '<S599>/byte6' */ |
| 33036 | L4_MABX_B.SFunction1_o6_c = L4_MABX_P.byte6_Y0_a; |
| 33037 | |
| 33038 | /* SystemInitialize for Outport: '<S599>/byte7' */ |
| 33039 | L4_MABX_B.SFunction1_o7_f = L4_MABX_P.byte7_Y0_b; |
| 33040 | |
| 33041 | /* SystemInitialize for Outport: '<S599>/byte8' */ |
| 33042 | L4_MABX_B.SFunction1_o8_o = L4_MABX_P.byte8_Y0_g; |
| 33043 | |
| 33044 | /* SystemInitialize for Outport: '<S599>/RX status' */ |
| 33045 | L4_MABX_B.SFunction1_o9_d = L4_MABX_P.RXstatus_Y0_bs; |
| 33046 | |
| 33047 | /* SystemInitialize for Outport: '<S599>/RX time' */ |
| 33048 | L4_MABX_B.SFunction1_o10_g = L4_MABX_P.RXtime_Y0_c1; |
| 33049 | |
| 33050 | /* SystemInitialize for Outport: '<S599>/RX delta time' */ |
| 33051 | L4_MABX_B.SFunction1_o11_k = L4_MABX_P.RXdeltatime_Y0_a; |
| 33052 | |
| 33053 | /* End of SystemInitialize for SubSystem: '<S595>/CAN_TYPE1_RX_M1_C1' */ |
| 33054 | |
| 33055 | /* SystemInitialize for Enabled SubSystem: '<S596>/CAN_TYPE1_RX_M1_C2' */ |
| 33056 | /* SystemInitialize for Outport: '<S600>/byte1' */ |
| 33057 | L4_MABX_B.SFunction1_o1_km = L4_MABX_P.byte1_Y0_a; |
| 33058 | |
| 33059 | /* SystemInitialize for Outport: '<S600>/byte2' */ |
| 33060 | L4_MABX_B.SFunction1_o2_po = L4_MABX_P.byte2_Y0_pw; |
| 33061 | |
| 33062 | /* SystemInitialize for Outport: '<S600>/byte3' */ |
| 33063 | L4_MABX_B.SFunction1_o3_mb = L4_MABX_P.byte3_Y0_ou; |
| 33064 | |
| 33065 | /* SystemInitialize for Outport: '<S600>/byte4' */ |
| 33066 | L4_MABX_B.SFunction1_o4_m4 = L4_MABX_P.byte4_Y0_h; |
| 33067 | |
| 33068 | /* SystemInitialize for Outport: '<S600>/byte5' */ |
| 33069 | L4_MABX_B.SFunction1_o5_ac = L4_MABX_P.byte5_Y0_j; |
| 33070 | |
| 33071 | /* SystemInitialize for Outport: '<S600>/byte6' */ |
| 33072 | L4_MABX_B.SFunction1_o6_kg = L4_MABX_P.byte6_Y0_au; |
| 33073 | |
| 33074 | /* SystemInitialize for Outport: '<S600>/byte7' */ |
| 33075 | L4_MABX_B.SFunction1_o7_ow = L4_MABX_P.byte7_Y0_a; |
| 33076 | |
| 33077 | /* SystemInitialize for Outport: '<S600>/byte8' */ |
| 33078 | L4_MABX_B.SFunction1_o8_n1 = L4_MABX_P.byte8_Y0_d; |
| 33079 | |
| 33080 | /* SystemInitialize for Outport: '<S600>/RX status' */ |
| 33081 | L4_MABX_B.SFunction1_o9_c = L4_MABX_P.RXstatus_Y0_a4; |
| 33082 | |
| 33083 | /* SystemInitialize for Outport: '<S600>/RX time' */ |
| 33084 | L4_MABX_B.SFunction1_o10_c = L4_MABX_P.RXtime_Y0_h1; |
| 33085 | |
| 33086 | /* SystemInitialize for Outport: '<S600>/RX delta time' */ |
| 33087 | L4_MABX_B.SFunction1_o11_o = L4_MABX_P.RXdeltatime_Y0_nn; |
| 33088 | |
| 33089 | /* End of SystemInitialize for SubSystem: '<S596>/CAN_TYPE1_RX_M1_C2' */ |
| 33090 | |
| 33091 | /* SystemInitialize for Enabled SubSystem: '<S597>/CAN_TYPE1_RX_M3_C2' */ |
| 33092 | /* SystemInitialize for Outport: '<S601>/byte1' */ |
| 33093 | L4_MABX_B.SFunction1_o1_e = L4_MABX_P.byte1_Y0_h; |
| 33094 | |
| 33095 | /* SystemInitialize for Outport: '<S601>/byte2' */ |
| 33096 | L4_MABX_B.SFunction1_o2_mi = L4_MABX_P.byte2_Y0_kh; |
| 33097 | |
| 33098 | /* SystemInitialize for Outport: '<S601>/byte3' */ |
| 33099 | L4_MABX_B.SFunction1_o3_bx = L4_MABX_P.byte3_Y0_m; |
| 33100 | |
| 33101 | /* SystemInitialize for Outport: '<S601>/byte4' */ |
| 33102 | L4_MABX_B.SFunction1_o4_cv5 = L4_MABX_P.byte4_Y0_k; |
| 33103 | |
| 33104 | /* SystemInitialize for Outport: '<S601>/byte5' */ |
| 33105 | L4_MABX_B.SFunction1_o5_dg = L4_MABX_P.byte5_Y0_l; |
| 33106 | |
| 33107 | /* SystemInitialize for Outport: '<S601>/byte6' */ |
| 33108 | L4_MABX_B.SFunction1_o6_m = L4_MABX_P.byte6_Y0_b; |
| 33109 | |
| 33110 | /* SystemInitialize for Outport: '<S601>/byte7' */ |
| 33111 | L4_MABX_B.SFunction1_o7_o = L4_MABX_P.byte7_Y0_p; |
| 33112 | |
| 33113 | /* SystemInitialize for Outport: '<S601>/byte8' */ |
| 33114 | L4_MABX_B.SFunction1_o8_p = L4_MABX_P.byte8_Y0_k; |
| 33115 | |
| 33116 | /* SystemInitialize for Outport: '<S601>/RX status' */ |
| 33117 | L4_MABX_B.SFunction1_o9_on = L4_MABX_P.RXstatus_Y0_kr; |
| 33118 | |
| 33119 | /* SystemInitialize for Outport: '<S601>/RX time' */ |
| 33120 | L4_MABX_B.SFunction1_o10_of = L4_MABX_P.RXtime_Y0_mi; |
| 33121 | |
| 33122 | /* SystemInitialize for Outport: '<S601>/RX delta time' */ |
| 33123 | L4_MABX_B.SFunction1_o11_d = L4_MABX_P.RXdeltatime_Y0_gg; |
| 33124 | |
| 33125 | /* End of SystemInitialize for SubSystem: '<S597>/CAN_TYPE1_RX_M3_C2' */ |
| 33126 | |
| 33127 | /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_1' */ |
| 33128 | /* InitializeConditions for UnitDelay: '<S30>/Unit_Delay' */ |
| 33129 | L4_MABX_DW.Unit_Delay_DSTATE_f1 = L4_MABX_P.Unit_Delay_InitialCondition_e3; |
| 33130 | |
| 33131 | /* InitializeConditions for UnitDelay: '<S31>/Unit Delay' */ |
| 33132 | L4_MABX_DW.UnitDelay_DSTATE_j = L4_MABX_P.UnitDelay_InitialCondition_n; |
| 33133 | |
| 33134 | /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_1' */ |
| 33135 | |
| 33136 | /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_5' */ |
| 33137 | /* InitializeConditions for UnitDelay: '<S54>/Unit_Delay' */ |
| 33138 | L4_MABX_DW.Unit_Delay_DSTATE_i5y = L4_MABX_P.Unit_Delay_InitialCondition_o; |
| 33139 | |
| 33140 | /* InitializeConditions for UnitDelay: '<S55>/Unit Delay' */ |
| 33141 | L4_MABX_DW.UnitDelay_DSTATE_p = L4_MABX_P.UnitDelay_InitialCondition_p; |
| 33142 | |
| 33143 | /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_5' */ |
| 33144 | |
| 33145 | /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_6' */ |
| 33146 | /* InitializeConditions for UnitDelay: '<S60>/Unit_Delay' */ |
| 33147 | L4_MABX_DW.Unit_Delay_DSTATE_l5 = L4_MABX_P.Unit_Delay_InitialCondition_le; |
| 33148 | |
| 33149 | /* InitializeConditions for UnitDelay: '<S61>/Unit Delay' */ |
| 33150 | L4_MABX_DW.UnitDelay_DSTATE_dr = L4_MABX_P.UnitDelay_InitialCondition_iv; |
| 33151 | |
| 33152 | /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_6' */ |
| 33153 | |
| 33154 | /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_3' */ |
| 33155 | /* InitializeConditions for UnitDelay: '<S42>/Unit_Delay' */ |
| 33156 | L4_MABX_DW.Unit_Delay_DSTATE_h41 = L4_MABX_P.Unit_Delay_InitialCondition_m; |
| 33157 | |
| 33158 | /* InitializeConditions for UnitDelay: '<S43>/Unit Delay' */ |
| 33159 | L4_MABX_DW.UnitDelay_DSTATE_dr4 = L4_MABX_P.UnitDelay_InitialCondition_hk; |
| 33160 | |
| 33161 | /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_3' */ |
| 33162 | |
| 33163 | /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_4' */ |
| 33164 | /* InitializeConditions for UnitDelay: '<S48>/Unit_Delay' */ |
| 33165 | L4_MABX_DW.Unit_Delay_DSTATE_mq = L4_MABX_P.Unit_Delay_InitialCondition_bo; |
| 33166 | |
| 33167 | /* InitializeConditions for UnitDelay: '<S49>/Unit Delay' */ |
| 33168 | L4_MABX_DW.UnitDelay_DSTATE_h = L4_MABX_P.UnitDelay_InitialCondition_l; |
| 33169 | |
| 33170 | /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_4' */ |
| 33171 | |
| 33172 | /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_2' */ |
| 33173 | /* InitializeConditions for UnitDelay: '<S36>/Unit_Delay' */ |
| 33174 | L4_MABX_DW.Unit_Delay_DSTATE_je = L4_MABX_P.Unit_Delay_InitialCondition_in; |
| 33175 | |
| 33176 | /* InitializeConditions for UnitDelay: '<S37>/Unit Delay' */ |
| 33177 | L4_MABX_DW.UnitDelay_DSTATE_bv = L4_MABX_P.UnitDelay_InitialCondition_m; |
| 33178 | |
| 33179 | /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_2' */ |
| 33180 | } |
| 33181 | } |
| 33182 | |
| 33183 | /* Model terminate function */ |
| 33184 | void L4_MABX_terminate(void) |
| 33185 | { |
| 33186 | /* Terminate for Atomic SubSystem: '<S849>/CAN_TX_1000ms' */ |
| 33187 | |
| 33188 | /* Terminate for Enabled SubSystem: '<S869>/AIR1' */ |
| 33189 | |
| 33190 | /* Terminate for S-Function (rti_commonblock): '<S870>/S-Function1' */ |
| 33191 | |
| 33192 | /* dSPACE RTICAN TX Message Block: "AIR1" Id:419343921 */ |
| 33193 | { |
| 33194 | /* ... Set the message into sleep mode */ |
| 33195 | while ((rtican_type1_tq_error[1][3] = can_tp1_msg_sleep |
| 33196 | (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31])) == |
| 33197 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33198 | } |
| 33199 | |
| 33200 | /* End of Terminate for SubSystem: '<S869>/AIR1' */ |
| 33201 | |
| 33202 | /* Terminate for Enabled SubSystem: '<S877>/AMB' */ |
| 33203 | |
| 33204 | /* Terminate for S-Function (rti_commonblock): '<S878>/S-Function1' */ |
| 33205 | |
| 33206 | /* dSPACE RTICAN TX Message Block: "AMB" Id:419362048 */ |
| 33207 | { |
| 33208 | /* ... Set the message into sleep mode */ |
| 33209 | while ((rtican_type1_tq_error[1][4] = can_tp1_msg_sleep |
| 33210 | (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500])) == |
| 33211 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33212 | } |
| 33213 | |
| 33214 | /* End of Terminate for SubSystem: '<S877>/AMB' */ |
| 33215 | |
| 33216 | /* End of Terminate for SubSystem: '<S849>/CAN_TX_1000ms' */ |
| 33217 | |
| 33218 | /* Terminate for S-Function (dsa_tcpip_setup_sfcn): '<S399>/dsa_tcpip_setup' */ |
| 33219 | /* Level2 S-Function Block: '<S399>/dsa_tcpip_setup' (dsa_tcpip_setup_sfcn) */ |
| 33220 | { |
| 33221 | SimStruct *rts = L4_MABX_M->childSfunctions[3]; |
| 33222 | sfcnTerminate(rts); |
| 33223 | } |
| 33224 | |
| 33225 | /* Terminate for S-Function (dsa_tcpip_udp_sfcn): '<S400>/TCPIP_Com' */ |
| 33226 | /* Level2 S-Function Block: '<S400>/TCPIP_Com' (dsa_tcpip_udp_sfcn) */ |
| 33227 | { |
| 33228 | SimStruct *rts = L4_MABX_M->childSfunctions[4]; |
| 33229 | sfcnTerminate(rts); |
| 33230 | } |
| 33231 | |
| 33232 | /* Terminate for Atomic SubSystem: '<S849>/CAN_TX_100ms' */ |
| 33233 | |
| 33234 | /* Terminate for Enabled SubSystem: '<S908>/PropB_XPR_FC' */ |
| 33235 | |
| 33236 | /* Terminate for S-Function (rti_commonblock): '<S910>/S-Function1' */ |
| 33237 | |
| 33238 | /* dSPACE RTICAN TX Message Block: "PropB_XPR_FC" Id:419366140 */ |
| 33239 | { |
| 33240 | /* ... Set the message into sleep mode */ |
| 33241 | while ((rtican_type1_tq_error[0][4] = can_tp1_msg_sleep |
| 33242 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC])) == |
| 33243 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33244 | } |
| 33245 | |
| 33246 | /* End of Terminate for SubSystem: '<S908>/PropB_XPR_FC' */ |
| 33247 | |
| 33248 | /* Terminate for Enabled SubSystem: '<S909>/PropB_XPR_FC' */ |
| 33249 | |
| 33250 | /* Terminate for S-Function (rti_commonblock): '<S911>/S-Function1' */ |
| 33251 | |
| 33252 | /* dSPACE RTICAN TX Message Block: "PropB_XPR_FC" Id:419366140 */ |
| 33253 | { |
| 33254 | /* ... Set the message into sleep mode */ |
| 33255 | while ((rtican_type1_tq_error[1][4] = can_tp1_msg_sleep |
| 33256 | (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC])) == |
| 33257 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33258 | } |
| 33259 | |
| 33260 | /* End of Terminate for SubSystem: '<S909>/PropB_XPR_FC' */ |
| 33261 | |
| 33262 | /* Terminate for Enabled SubSystem: '<S938>/Std_PosRapidUpdate_01' */ |
| 33263 | |
| 33264 | /* Terminate for S-Function (rti_commonblock): '<S939>/S-Function1' */ |
| 33265 | |
| 33266 | /* dSPACE RTICAN TX Message Block: "Std_PosRapidUpdate_01" Id:3 */ |
| 33267 | { |
| 33268 | /* ... Set the message into sleep mode */ |
| 33269 | while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep |
| 33270 | (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3])) == |
| 33271 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33272 | } |
| 33273 | |
| 33274 | /* End of Terminate for SubSystem: '<S938>/Std_PosRapidUpdate_01' */ |
| 33275 | |
| 33276 | /* Terminate for Enabled SubSystem: '<S888>/CCVS1_00' */ |
| 33277 | |
| 33278 | /* Terminate for S-Function (rti_commonblock): '<S890>/S-Function1' */ |
| 33279 | |
| 33280 | /* dSPACE RTICAN TX Message Block: "CCVS1_00" Id:419361024 */ |
| 33281 | { |
| 33282 | /* ... Set the message into sleep mode */ |
| 33283 | while ((rtican_type1_tq_error[0][3] = can_tp1_msg_sleep |
| 33284 | (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100])) == |
| 33285 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33286 | } |
| 33287 | |
| 33288 | /* End of Terminate for SubSystem: '<S888>/CCVS1_00' */ |
| 33289 | |
| 33290 | /* Terminate for Enabled SubSystem: '<S889>/CCVS1_00' */ |
| 33291 | |
| 33292 | /* Terminate for S-Function (rti_commonblock): '<S891>/S-Function1' */ |
| 33293 | |
| 33294 | /* dSPACE RTICAN TX Message Block: "CCVS1_00" Id:218034432 */ |
| 33295 | { |
| 33296 | /* ... Set the message into sleep mode */ |
| 33297 | while ((rtican_type1_tq_error[2][3] = can_tp1_msg_sleep |
| 33298 | (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100])) == |
| 33299 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33300 | } |
| 33301 | |
| 33302 | /* End of Terminate for SubSystem: '<S889>/CCVS1_00' */ |
| 33303 | |
| 33304 | /* Terminate for Enabled SubSystem: '<S892>/PropB_REAX_5_E4' */ |
| 33305 | |
| 33306 | /* Terminate for S-Function (rti_commonblock): '<S894>/S-Function1' incorporates: |
| 33307 | * Constant: '<S892>/Constant' |
| 33308 | * Constant: '<S892>/Constant1' |
| 33309 | */ |
| 33310 | |
| 33311 | /* dSPACE RTICAN TX Message Block: "PropB_REAX_5_E4" Id:419429092 */ |
| 33312 | { |
| 33313 | /* ... Set the message into sleep mode */ |
| 33314 | while ((rtican_type1_tq_error[0][5] = can_tp1_msg_sleep |
| 33315 | (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FFFAE4])) == |
| 33316 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33317 | } |
| 33318 | |
| 33319 | /* End of Terminate for SubSystem: '<S892>/PropB_REAX_5_E4' */ |
| 33320 | |
| 33321 | /* Terminate for Enabled SubSystem: '<S893>/PropB_REAX_5_E4' */ |
| 33322 | |
| 33323 | /* Terminate for S-Function (rti_commonblock): '<S895>/S-Function1' incorporates: |
| 33324 | * Constant: '<S893>/Constant' |
| 33325 | * Constant: '<S893>/Constant1' |
| 33326 | */ |
| 33327 | |
| 33328 | /* dSPACE RTICAN TX Message Block: "PropB_REAX_5_E4" Id:419429092 */ |
| 33329 | { |
| 33330 | /* ... Set the message into sleep mode */ |
| 33331 | while ((rtican_type1_tq_error[2][4] = can_tp1_msg_sleep |
| 33332 | (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0X18FFFAE4])) == |
| 33333 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33334 | } |
| 33335 | |
| 33336 | /* End of Terminate for SubSystem: '<S893>/PropB_REAX_5_E4' */ |
| 33337 | |
| 33338 | /* Terminate for Enabled SubSystem: '<S912>/Std_COGSOGRapidUpdate_01' */ |
| 33339 | |
| 33340 | /* Terminate for S-Function (rti_commonblock): '<S913>/S-Function1' incorporates: |
| 33341 | * Constant: '<S912>/Constant' |
| 33342 | * Constant: '<S912>/Constant1' |
| 33343 | */ |
| 33344 | |
| 33345 | /* dSPACE RTICAN TX Message Block: "Std_COGSOGRapidUpdate_01" Id:7 */ |
| 33346 | { |
| 33347 | /* ... Set the message into sleep mode */ |
| 33348 | while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep |
| 33349 | (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X7])) == |
| 33350 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33351 | } |
| 33352 | |
| 33353 | /* End of Terminate for SubSystem: '<S912>/Std_COGSOGRapidUpdate_01' */ |
| 33354 | |
| 33355 | /* Terminate for Enabled SubSystem: '<S914>/EBC1_TX' */ |
| 33356 | |
| 33357 | /* Terminate for S-Function (rti_commonblock): '<S915>/S-Function1' */ |
| 33358 | |
| 33359 | /* dSPACE RTICAN TX Message Block: "EBC1_TX" Id:418382219 */ |
| 33360 | { |
| 33361 | /* ... Set the message into sleep mode */ |
| 33362 | while ((rtican_type1_tq_error[0][2] = can_tp1_msg_sleep |
| 33363 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B])) == |
| 33364 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33365 | } |
| 33366 | |
| 33367 | /* End of Terminate for SubSystem: '<S914>/EBC1_TX' */ |
| 33368 | |
| 33369 | /* End of Terminate for SubSystem: '<S849>/CAN_TX_100ms' */ |
| 33370 | |
| 33371 | /* Terminate for Atomic SubSystem: '<S849>/CAN_TX_10ms' */ |
| 33372 | |
| 33373 | /* Terminate for Enabled SubSystem: '<S951>/ACCS' */ |
| 33374 | |
| 33375 | /* Terminate for S-Function (rti_commonblock): '<S952>/S-Function1' */ |
| 33376 | |
| 33377 | /* dSPACE RTICAN TX Message Block: "ACCS" Id:418393572 */ |
| 33378 | { |
| 33379 | /* ... Set the message into sleep mode */ |
| 33380 | while ((rtican_type1_tq_error[1][3] = can_tp1_msg_sleep |
| 33381 | (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4])) == |
| 33382 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33383 | } |
| 33384 | |
| 33385 | /* End of Terminate for SubSystem: '<S951>/ACCS' */ |
| 33386 | |
| 33387 | /* Terminate for Enabled SubSystem: '<S959>/EEC1_00' */ |
| 33388 | |
| 33389 | /* Terminate for S-Function (rti_commonblock): '<S961>/S-Function1' */ |
| 33390 | |
| 33391 | /* dSPACE RTICAN TX Message Block: "EEC1_00" Id:217056256 */ |
| 33392 | { |
| 33393 | /* ... Set the message into sleep mode */ |
| 33394 | while ((rtican_type1_tq_error[1][1] = can_tp1_msg_sleep |
| 33395 | (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400])) == |
| 33396 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33397 | } |
| 33398 | |
| 33399 | /* End of Terminate for SubSystem: '<S959>/EEC1_00' */ |
| 33400 | |
| 33401 | /* Terminate for Enabled SubSystem: '<S960>/EEC1_00' */ |
| 33402 | |
| 33403 | /* Terminate for S-Function (rti_commonblock): '<S962>/S-Function1' */ |
| 33404 | |
| 33405 | /* dSPACE RTICAN TX Message Block: "EEC1_00" Id:217056256 */ |
| 33406 | { |
| 33407 | /* ... Set the message into sleep mode */ |
| 33408 | while ((rtican_type1_tq_error[2][3] = can_tp1_msg_sleep |
| 33409 | (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400])) == |
| 33410 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33411 | } |
| 33412 | |
| 33413 | /* End of Terminate for SubSystem: '<S960>/EEC1_00' */ |
| 33414 | |
| 33415 | /* Terminate for Enabled SubSystem: '<S963>/PropB_REAX_1_E4' */ |
| 33416 | |
| 33417 | /* Terminate for S-Function (rti_commonblock): '<S965>/S-Function1' incorporates: |
| 33418 | * Constant: '<S963>/Constant' |
| 33419 | * Constant: '<S963>/Constant1' |
| 33420 | */ |
| 33421 | |
| 33422 | /* dSPACE RTICAN TX Message Block: "PropB_REAX_1_E4" Id:419426276 */ |
| 33423 | { |
| 33424 | /* ... Set the message into sleep mode */ |
| 33425 | while ((rtican_type1_tq_error[0][4] = can_tp1_msg_sleep |
| 33426 | (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FFEFE4])) == |
| 33427 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33428 | } |
| 33429 | |
| 33430 | /* End of Terminate for SubSystem: '<S963>/PropB_REAX_1_E4' */ |
| 33431 | |
| 33432 | /* Terminate for Enabled SubSystem: '<S964>/PropB_REAX_1_E4' */ |
| 33433 | |
| 33434 | /* Terminate for S-Function (rti_commonblock): '<S966>/S-Function1' incorporates: |
| 33435 | * Constant: '<S964>/Constant' |
| 33436 | * Constant: '<S964>/Constant1' |
| 33437 | */ |
| 33438 | |
| 33439 | /* dSPACE RTICAN TX Message Block: "PropB_REAX_1_E4" Id:419426276 */ |
| 33440 | { |
| 33441 | /* ... Set the message into sleep mode */ |
| 33442 | while ((rtican_type1_tq_error[2][4] = can_tp1_msg_sleep |
| 33443 | (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0X18FFEFE4])) == |
| 33444 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33445 | } |
| 33446 | |
| 33447 | /* End of Terminate for SubSystem: '<S964>/PropB_REAX_1_E4' */ |
| 33448 | |
| 33449 | /* Terminate for Enabled SubSystem: '<S973>/VDC2_0B' */ |
| 33450 | |
| 33451 | /* Terminate for S-Function (rti_commonblock): '<S974>/S-Function1' */ |
| 33452 | |
| 33453 | /* dSPACE RTICAN TX Message Block: "VDC2_0B" Id:418384139 */ |
| 33454 | { |
| 33455 | /* ... Set the message into sleep mode */ |
| 33456 | while ((rtican_type1_tq_error[2][4] = can_tp1_msg_sleep |
| 33457 | (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B])) == |
| 33458 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33459 | } |
| 33460 | |
| 33461 | /* End of Terminate for SubSystem: '<S973>/VDC2_0B' */ |
| 33462 | |
| 33463 | /* End of Terminate for SubSystem: '<S849>/CAN_TX_10ms' */ |
| 33464 | |
| 33465 | /* Terminate for Atomic SubSystem: '<S849>/CAN_TX_20ms' */ |
| 33466 | |
| 33467 | /* Terminate for Enabled SubSystem: '<S1018>/PropB_XBR_B3' */ |
| 33468 | |
| 33469 | /* Terminate for S-Function (rti_commonblock): '<S1019>/S-Function1' */ |
| 33470 | |
| 33471 | /* dSPACE RTICAN TX Message Block: "PropB_XBR_B3" Id:218038707 */ |
| 33472 | { |
| 33473 | /* ... Set the message into sleep mode */ |
| 33474 | while ((rtican_type1_tq_error[1][2] = can_tp1_msg_sleep |
| 33475 | (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3])) == |
| 33476 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33477 | } |
| 33478 | |
| 33479 | /* End of Terminate for SubSystem: '<S1018>/PropB_XBR_B3' */ |
| 33480 | |
| 33481 | /* Terminate for Enabled SubSystem: '<S1020>/PropB_Bendix_2C2_XPR' */ |
| 33482 | |
| 33483 | /* Terminate for S-Function (rti_commonblock): '<S1021>/S-Function1' */ |
| 33484 | |
| 33485 | /* dSPACE RTICAN TX Message Block: "PropB_Bendix_2C2_XPR" Id:218060389 */ |
| 33486 | { |
| 33487 | /* ... Set the message into sleep mode */ |
| 33488 | while ((rtican_type1_tq_error[1][2] = can_tp1_msg_sleep |
| 33489 | (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665])) == |
| 33490 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33491 | } |
| 33492 | |
| 33493 | /* End of Terminate for SubSystem: '<S1020>/PropB_Bendix_2C2_XPR' */ |
| 33494 | |
| 33495 | /* Terminate for Enabled SubSystem: '<S1028>/Std_OdometryData' */ |
| 33496 | |
| 33497 | /* Terminate for S-Function (rti_commonblock): '<S1029>/S-Function1' */ |
| 33498 | |
| 33499 | /* dSPACE RTICAN TX Message Block: "Std_OdometryData" Id:10 */ |
| 33500 | { |
| 33501 | /* ... Set the message into sleep mode */ |
| 33502 | while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep |
| 33503 | (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA])) == |
| 33504 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33505 | } |
| 33506 | |
| 33507 | /* End of Terminate for SubSystem: '<S1028>/Std_OdometryData' */ |
| 33508 | |
| 33509 | /* End of Terminate for SubSystem: '<S849>/CAN_TX_20ms' */ |
| 33510 | |
| 33511 | /* Terminate for Atomic SubSystem: '<S849>/CAN_TX_5000ms' */ |
| 33512 | |
| 33513 | /* Terminate for Enabled SubSystem: '<S1043>/RQST_13_E4' */ |
| 33514 | |
| 33515 | /* Terminate for S-Function (rti_commonblock): '<S1045>/S-Function1' */ |
| 33516 | |
| 33517 | /* dSPACE RTICAN TX Message Block: "RQST_13_E4" Id:417993700 */ |
| 33518 | { |
| 33519 | /* ... Set the message into sleep mode */ |
| 33520 | while ((rtican_type1_tq_error[2][3] = can_tp1_msg_sleep |
| 33521 | (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4])) == |
| 33522 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33523 | } |
| 33524 | |
| 33525 | /* End of Terminate for SubSystem: '<S1043>/RQST_13_E4' */ |
| 33526 | |
| 33527 | /* End of Terminate for SubSystem: '<S849>/CAN_TX_5000ms' */ |
| 33528 | |
| 33529 | /* Terminate for Atomic SubSystem: '<S849>/CAN_TX_50ms' */ |
| 33530 | |
| 33531 | /* Terminate for Enabled SubSystem: '<S1054>/CCVS1_E3' */ |
| 33532 | |
| 33533 | /* Terminate for S-Function (rti_commonblock): '<S1056>/S-Function1' */ |
| 33534 | |
| 33535 | /* dSPACE RTICAN TX Message Block: "CCVS1_E3" Id:419361251 */ |
| 33536 | { |
| 33537 | /* ... Set the message into sleep mode */ |
| 33538 | while ((rtican_type1_tq_error[1][3] = can_tp1_msg_sleep |
| 33539 | (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3])) == |
| 33540 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33541 | } |
| 33542 | |
| 33543 | /* End of Terminate for SubSystem: '<S1054>/CCVS1_E3' */ |
| 33544 | |
| 33545 | /* Terminate for Enabled SubSystem: '<S1055>/TC1_03_05' */ |
| 33546 | |
| 33547 | /* Terminate for S-Function (rti_commonblock): '<S1057>/S-Function1' */ |
| 33548 | |
| 33549 | /* dSPACE RTICAN TX Message Block: "TC1_03_05" Id:201392901 */ |
| 33550 | { |
| 33551 | /* ... Set the message into sleep mode */ |
| 33552 | while ((rtican_type1_tq_error[0][0] = can_tp1_msg_sleep |
| 33553 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305])) == |
| 33554 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33555 | } |
| 33556 | |
| 33557 | /* End of Terminate for SubSystem: '<S1055>/TC1_03_05' */ |
| 33558 | |
| 33559 | /* End of Terminate for SubSystem: '<S849>/CAN_TX_50ms' */ |
| 33560 | |
| 33561 | /* Terminate for Enabled SubSystem: '<S1067>/Std_SystemTime_01' */ |
| 33562 | |
| 33563 | /* Terminate for S-Function (rti_commonblock): '<S1069>/S-Function1' incorporates: |
| 33564 | * Constant: '<S1067>/Constant' |
| 33565 | * Constant: '<S1067>/Constant1' |
| 33566 | */ |
| 33567 | |
| 33568 | /* dSPACE RTICAN TX Message Block: "Std_SystemTime_01" Id:5 */ |
| 33569 | { |
| 33570 | /* ... Set the message into sleep mode */ |
| 33571 | while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep |
| 33572 | (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X5])) == |
| 33573 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33574 | } |
| 33575 | |
| 33576 | /* End of Terminate for SubSystem: '<S1067>/Std_SystemTime_01' */ |
| 33577 | |
| 33578 | /* Terminate for Triggered SubSystem: '<S1062>/CAN_TYPE1_TX_M1_C1' */ |
| 33579 | |
| 33580 | /* Terminate for S-Function (rti_commonblock): '<S1064>/S-Function1' */ |
| 33581 | |
| 33582 | /* dSPACE RTICAN TX Message Block: "TX Message" Id:418184965 */ |
| 33583 | { |
| 33584 | /* ... Set the message into sleep mode */ |
| 33585 | while ((rtican_type1_tq_error[0][1] = can_tp1_msg_sleep |
| 33586 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05])) == |
| 33587 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33588 | } |
| 33589 | |
| 33590 | /* End of Terminate for SubSystem: '<S1062>/CAN_TYPE1_TX_M1_C1' */ |
| 33591 | |
| 33592 | /* Terminate for Triggered SubSystem: '<S1063>/CAN_TYPE1_TX_M1_C1' */ |
| 33593 | |
| 33594 | /* Terminate for S-Function (rti_commonblock): '<S1065>/S-Function1' */ |
| 33595 | |
| 33596 | /* dSPACE RTICAN TX Message Block: "TX Message" Id:418119429 */ |
| 33597 | { |
| 33598 | /* ... Set the message into sleep mode */ |
| 33599 | while ((rtican_type1_tq_error[0][1] = can_tp1_msg_sleep |
| 33600 | (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05])) == |
| 33601 | DSMCOM_BUFFER_OVERFLOW) ; |
| 33602 | } |
| 33603 | |
| 33604 | /* End of Terminate for SubSystem: '<S1063>/CAN_TYPE1_TX_M1_C1' */ |
| 33605 | |
| 33606 | /* Terminate for S-Function (rti_commonblock): '<S1070>/S-Function1' */ |
| 33607 | |
| 33608 | /* disable digital output channel 4 on port 1 * |
| 33609 | * (set to high-impedance), when the simulation terminates */ |
| 33610 | dio_tp4_digout_init(DIO_TP4_1_MODULE_ADDR, 1, DIO_TP4_MASK_CH4, |
| 33611 | DIO_TP4_LS_DISABLE, DIO_TP4_HS_DISABLE); |
| 33612 | |
| 33613 | /* Terminate for S-Function (rti_commonblock): '<S1071>/S-Function1' */ |
| 33614 | |
| 33615 | /* disable digital output channel 2 on port 1 * |
| 33616 | * (set to high-impedance), when the simulation terminates */ |
| 33617 | dio_tp4_digout_init(DIO_TP4_1_MODULE_ADDR, 1, DIO_TP4_MASK_CH2, |
| 33618 | DIO_TP4_LS_DISABLE, DIO_TP4_HS_DISABLE); |
| 33619 | |
| 33620 | /* Terminate for S-Function (rti_commonblock): '<S1072>/S-Function1' */ |
| 33621 | |
| 33622 | /* disable digital output channel 1 on port 1 * |
| 33623 | * (set to high-impedance), when the simulation terminates */ |
| 33624 | dio_tp4_digout_init(DIO_TP4_1_MODULE_ADDR, 1, DIO_TP4_MASK_CH1, |
| 33625 | DIO_TP4_LS_DISABLE, DIO_TP4_HS_DISABLE); |
| 33626 | |
| 33627 | /* Terminate for S-Function (rti_commonblock): '<S1073>/S-Function1' */ |
| 33628 | |
| 33629 | /* disable digital output channel 3 on port 1 * |
| 33630 | * (set to high-impedance), when the simulation terminates */ |
| 33631 | dio_tp4_digout_init(DIO_TP4_1_MODULE_ADDR, 1, DIO_TP4_MASK_CH3, |
| 33632 | DIO_TP4_LS_DISABLE, DIO_TP4_HS_DISABLE); |
| 33633 | |
| 33634 | /* Terminate for S-Function (rti_commonblock): '<S1074>/S-Function1' */ |
| 33635 | |
| 33636 | /* disable digital output channel 1 on port 2 * |
| 33637 | * (set to high-impedance), when the simulation terminates */ |
| 33638 | dio_tp4_pwm_init(DIO_TP4_1_MODULE_ADDR, 2, DIO_TP4_MASK_CH1, |
| 33639 | DIO_TP4_LS_DISABLE, DIO_TP4_HS_DISABLE, DIO_TP4_TIMING_RANGE2, |
| 33640 | DIO_TP4_PWM); |
| 33641 | |
| 33642 | /* Terminate for S-Function (rti_commonblock): '<S1075>/S-Function1' */ |
| 33643 | |
| 33644 | /* disable digital output channel 2 on port 2 * |
| 33645 | * (set to high-impedance), when the simulation terminates */ |
| 33646 | dio_tp4_pwm_init(DIO_TP4_1_MODULE_ADDR, 2, DIO_TP4_MASK_CH2, |
| 33647 | DIO_TP4_LS_DISABLE, DIO_TP4_HS_DISABLE, DIO_TP4_TIMING_RANGE2, |
| 33648 | DIO_TP4_PWM); |
| 33649 | |
| 33650 | /* Terminate for S-Function (rti_commonblock): '<S408>/S-Function1' incorporates: |
| 33651 | * SubSystem: '<S399>/Background_Task' |
| 33652 | */ |
| 33653 | L4_MAB_Background_Task_Term(); |
| 33654 | |
| 33655 | /* End of Terminate for S-Function (rti_commonblock): '<S408>/S-Function1' */ |
| 33656 | |
| 33657 | /* Terminate for S-Function (rti_commonblock): '<S414>/S-Function1' incorporates: |
| 33658 | * SubSystem: '<S399>/Interrupt_Task' |
| 33659 | */ |
| 33660 | L4_MABX_Interrupt_Task_Term(); |
| 33661 | |
| 33662 | /* End of Terminate for S-Function (rti_commonblock): '<S414>/S-Function1' */ |
| 33663 | |
| 33664 | /* Terminate for S-Function (rti_commonblock): '<S460>/S-Function1' */ |
| 33665 | |
| 33666 | /* dSPACE RTICAN STD Srvc-Message Block */ |
| 33667 | { |
| 33668 | /* ... Set the message into sleep mode */ |
| 33669 | while ((rtican_type1_tq_error[0][0] = can_tp1_msg_sleep |
| 33670 | (CANTP1_RX_SPMSG_M1_C1_STD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 33671 | } |
| 33672 | |
| 33673 | /* dSPACE RTICAN XTD Srvc-Message Block */ |
| 33674 | { |
| 33675 | /* ... Set the message into sleep mode */ |
| 33676 | while ((rtican_type1_tq_error[0][1] = can_tp1_msg_sleep |
| 33677 | (CANTP1_RX_SPMSG_M1_C1_XTD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 33678 | } |
| 33679 | |
| 33680 | /* Terminate for S-Function (rti_commonblock): '<S461>/S-Function1' */ |
| 33681 | |
| 33682 | /* dSPACE RTICAN STD Srvc-Message Block */ |
| 33683 | { |
| 33684 | /* ... Set the message into sleep mode */ |
| 33685 | while ((rtican_type1_tq_error[0][0] = can_tp1_msg_sleep |
| 33686 | (CANTP1_RX_SPMSG_M1_C2_STD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 33687 | } |
| 33688 | |
| 33689 | /* dSPACE RTICAN XTD Srvc-Message Block */ |
| 33690 | { |
| 33691 | /* ... Set the message into sleep mode */ |
| 33692 | while ((rtican_type1_tq_error[0][1] = can_tp1_msg_sleep |
| 33693 | (CANTP1_RX_SPMSG_M1_C2_XTD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 33694 | } |
| 33695 | |
| 33696 | /* Terminate for S-Function (rti_commonblock): '<S462>/S-Function1' */ |
| 33697 | |
| 33698 | /* dSPACE RTICAN STD Srvc-Message Block */ |
| 33699 | { |
| 33700 | /* ... Set the message into sleep mode */ |
| 33701 | while ((rtican_type1_tq_error[1][0] = can_tp1_msg_sleep |
| 33702 | (CANTP1_RX_SPMSG_M2_C1_STD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 33703 | } |
| 33704 | |
| 33705 | /* dSPACE RTICAN XTD Srvc-Message Block */ |
| 33706 | { |
| 33707 | /* ... Set the message into sleep mode */ |
| 33708 | while ((rtican_type1_tq_error[1][1] = can_tp1_msg_sleep |
| 33709 | (CANTP1_RX_SPMSG_M2_C1_XTD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 33710 | } |
| 33711 | |
| 33712 | /* Terminate for S-Function (rti_commonblock): '<S463>/S-Function1' */ |
| 33713 | |
| 33714 | /* dSPACE RTICAN STD Srvc-Message Block */ |
| 33715 | { |
| 33716 | /* ... Set the message into sleep mode */ |
| 33717 | while ((rtican_type1_tq_error[1][0] = can_tp1_msg_sleep |
| 33718 | (CANTP1_RX_SPMSG_M2_C2_STD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 33719 | } |
| 33720 | |
| 33721 | /* dSPACE RTICAN XTD Srvc-Message Block */ |
| 33722 | { |
| 33723 | /* ... Set the message into sleep mode */ |
| 33724 | while ((rtican_type1_tq_error[1][1] = can_tp1_msg_sleep |
| 33725 | (CANTP1_RX_SPMSG_M2_C2_XTD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 33726 | } |
| 33727 | |
| 33728 | /* Terminate for S-Function (rti_commonblock): '<S464>/S-Function1' */ |
| 33729 | |
| 33730 | /* dSPACE RTICAN STD Srvc-Message Block */ |
| 33731 | { |
| 33732 | /* ... Set the message into sleep mode */ |
| 33733 | while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep |
| 33734 | (CANTP1_RX_SPMSG_M3_C1_STD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 33735 | } |
| 33736 | |
| 33737 | /* dSPACE RTICAN XTD Srvc-Message Block */ |
| 33738 | { |
| 33739 | /* ... Set the message into sleep mode */ |
| 33740 | while ((rtican_type1_tq_error[2][1] = can_tp1_msg_sleep |
| 33741 | (CANTP1_RX_SPMSG_M3_C1_XTD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 33742 | } |
| 33743 | |
| 33744 | /* Terminate for S-Function (rti_commonblock): '<S465>/S-Function1' */ |
| 33745 | |
| 33746 | /* dSPACE RTICAN STD Srvc-Message Block */ |
| 33747 | { |
| 33748 | /* ... Set the message into sleep mode */ |
| 33749 | while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep |
| 33750 | (CANTP1_RX_SPMSG_M3_C2_STD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 33751 | } |
| 33752 | |
| 33753 | /* dSPACE RTICAN XTD Srvc-Message Block */ |
| 33754 | { |
| 33755 | /* ... Set the message into sleep mode */ |
| 33756 | while ((rtican_type1_tq_error[2][1] = can_tp1_msg_sleep |
| 33757 | (CANTP1_RX_SPMSG_M3_C2_XTD)) == DSMCOM_BUFFER_OVERFLOW) ; |
| 33758 | } |
| 33759 | } |
| 33760 | |